From 03d64543d4ae650c2165ee84d36e8870127184e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sat, 20 Jul 2024 03:26:11 +0300 Subject: [PATCH 01/35] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B5=D0=B7?= =?UTF-8?q?=D0=B4=20=D0=BD=D0=B0=20=D0=BF=D0=B0=D1=82=D1=82=D0=B5=D1=80?= =?UTF-8?q?=D0=BD=20"=D0=9F=D0=BE=D1=81=D0=B5=D1=82=D0=B8=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C"=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Добавил пакет с контрактом паттерна "Посетитель", на который переведу AST * migration to Visitor.NET 2.0.0 * базис внедрения шаблона Посетитель * move folder * merge * small refactoring + two nodes * fix build * Новая система адресации инструкций (#21) * initial of the branch * контракт адреса * Переезд на .NET 7 (#24) * обновление sdk в проекте * обновление sdk в ci * переход на json raw string literal * обновление nuget пакетов * Генерация отчёта о покрытии на уровне конфигурации проекта https://github.com/coverlet-coverage/coverlet/issues/1391 * Генерация отчёта о покрытии на уровне конфигурации проекта https://github.com/coverlet-coverage/coverlet/issues/1391 * versioning * Update Readme.md * draft алгоритма работы коллекции * Использование последних наворотов шарпа (#26) * versioning * enabling implicit usings (#25) * local scoped namespaces (#27) * after merge * разработка алгоритма вставки в коллекцию * пакетная вставка * доработка алгоритма вставки * индексатор * прямая итерация над коллекцией * важная доработка вставки - сгенерированный адрес проставляется инструкции, больше не требуется создавать адрес для создания инструкции * переименовал сущность адреса * доработка массовой вставки * алгоритм удаления инструкции * unit tests * more tests * переписал новые визиторы на AddressedInstructions * удаление конструкта "номер инструкции" * допиливание работы с Label.cs * удаление конструкта номера из алгоритмов инструкций * прогон инструкций в виртуальной машине по адресу * переписывание алгоритмов инструкций на работу с адресами * текущая реализация не требует такой сложной конструкции инструкции возврата * remove unused * подправил контракт AST * block statement * Proper HasReturnStatementImplementation * removed unused code * перегруппировка * address system refactoring * HashedAddress.cs fix * AddressedInstructions.cs fix * introducing brand new visitor architecture * unary expression visitor * refactoring + error removal * Simple.cs fix * BinaryExpression refactoring * move AddressedInstructions.cs back * remove unused * as string code gen * Constant.cs refactoring * доработка генерации существующих функций ExpressionInstructionProvider.cs * ArrayLiteral.cs visit * TypeStatement.cs fix * InsideLoopStatement.cs visit * ExpressionStatement.cs visit * ReturnStatement.cs visit * Label.cs fix * remove redunant override * Property.cs refactoring * ObjectLiteral.cs + FunctionDeclaration.cs visitor refactoring & decoupling * WhileStatement.cs visit refactoring * IfStatement.cs refactoring with visitor * IfStatement.cs fix * ConditionalExpression.cs visit fix * AssignmentExpression.cs visitor * fix * fix tests * ComplexLiteral.cs * AssignmentExpression visit fix * Исправление некорректной грамматики (#28) * new grammar.txt content * format grammar.txt * grammar fix * MemberExpression.cs visiting * refactoring * fix * replacement function in AddressedInstructions.cs * AssignmentExpression visiting fix * fix * call expr print * fix parser * parser fix 2 * restructuring * script body visit fix * formatting * parser fix * refactoring * semantic assertion draft * break support in if statatement * enum rename * rename * exceptions excluded from codecov * some semantic analysis rework * removed some tests * supress code cov * suppress * ReturnStatement.cs semantic * renane * parser fix * rename * move * mv SemanticChecker.cs * new visitor * region * SymbolTableBuilder.cs completed * module refactoring * removed symbol table construction from parsing * SymbolTableInitializer fix * integration with symbol table initializer * refactoring * DeclarationVisitor.cs * usage of decl visitor * fix recursion * - Visiting type decl - New type symbol - Removed types dict from symbol table * fix * small fix * update nuget * symbol refactoring * some work stuck long time ago * symbol state * предварительная версия инициализатора имён * fix ci * complete type loading system rework * type resolving example * refactoring of default js types consuming and custom types resolving * fix function codegen bug - end label was not emitted * type domain refactored * pre-load built types before reference resolving * fix bug in object type ref resolving * hierarchy enhancement * guard of type duplicates and built-in types declaration * initialized/declared type symbols * some new checks * more refac * proper render of type values * guard declarations from duplicates * do not return null * binary and unary expressions check * fix bug sequence has no elements * guard against no initializer * formatting * there is not symbol without initializer thus symbol cannot be not initialized * working with assignments * checking access expressions * check object literal without methods * реструктуризация сервисов посетителей * рефакторинг после реструктуризации * удалил ненавистный Utils * рефакторинг объектного типа * сохранение функций в хранилище, для которых не был сразу выведен возвращаемый тип, чтобы впоследствии его вычислить * call expr check v1 * fix * перенос проверок функции статическим анализом * Починил бекенд при работе с анонимными массивами и объектами * доработка вывода типов * поправил вывод типов в части необработанных функций * обновление версий экшенов * вторая волна обновлений * upd workflows * global using visitor.net * fix func decl gen * Revert "fix func decl gen" This reverts commit ef976231995909a2394a24170e5944ec4fc8dd4f. * visit fix * Имеет ли функция пустое тело * исправил ошибку кодогенерации if statement при отсутствии else блока * базовая кодогенерация для вызова функции без учета метода объекта * доработка вывода типов * починил статический анализ доступа к элементу массива по индексу * fix * rename to hydrascript * #15 - удалил методы из объекта * #15 - удалил концепцию метода из бекенда * #15 - удалил FunctionType.cs * #15 - статический анализ вызова метода * #15 - кодогенерация вызова метода * #15 - актуализация лексической структуры * #15 - доработка "забытого" статического анализа * #15 - поправил кодген if-else * rm * #15 - если у функции не прописан тип и нет return'ов, то она void * #15 - корректировка примеров * #23 - рабочий пример --- .github/workflows/cla.yml | 2 +- .github/workflows/develop.yml | 18 +- .github/workflows/release.yml | 12 +- CONTRIBUTING.md | 2 +- ExtendedJavaScriptSubset.sln | 6 +- .../BackEnd/AddressedInstructions.cs | 83 ++ .../BackEnd/Addresses/HashAddress.cs | 29 + HydraScript.Lib/BackEnd/Addresses/IAddress.cs | 6 + HydraScript.Lib/BackEnd/Addresses/Label.cs | 25 + .../BackEnd/Instructions/BlockLabel.cs | 48 + HydraScript.Lib/BackEnd/Instructions/Halt.cs | 16 + .../BackEnd/Instructions/Instruction.cs | 29 + HydraScript.Lib/BackEnd/Instructions/Print.cs | 21 + .../BackEnd/Instructions/PushParameter.cs | 22 + .../BackEnd/Instructions/RemoveFromArray.cs | 24 + .../BackEnd/Instructions/Return.cs | 27 + .../Instructions/WithAssignment/AsString.cs | 32 + .../WithAssignment/CallFunction.cs | 49 + .../ComplexData/Create/CreateArray.cs | 22 + .../ComplexData/Create/CreateObject.cs | 21 + .../ComplexData/Read/DotRead.cs | 29 + .../ComplexData/Read/IReadFromComplexData.cs | 10 + .../ComplexData/Read/IndexRead.cs | 27 + .../ComplexData/Write/DotAssignment.cs | 26 + .../ComplexData/Write/IWriteToComplexData.cs | 6 + .../ComplexData/Write/IndexAssignment.cs | 26 + .../Instructions/WithAssignment/Simple.cs | 101 +++ .../BackEnd/Instructions/WithJump/Goto.cs | 31 + .../Instructions/WithJump/IfNotGoto.cs | 24 + .../BackEnd/Values/Constant.cs | 5 +- .../BackEnd/Values/IValue.cs | 2 +- .../BackEnd/Values/Name.cs | 2 +- HydraScript.Lib/BackEnd/VirtualMachine.cs | 67 ++ .../FrontEnd/GetTokens/Data/Structure.cs | 8 +- .../FrontEnd/GetTokens/Data/Token.cs | 4 +- .../Data/TokenTypes/EndOfProgramType.cs | 2 +- .../GetTokens/Data/TokenTypes/ErrorType.cs | 2 +- .../Data/TokenTypes/IgnorableType.cs | 2 +- .../GetTokens/Data/TokenTypes/TokenType.cs | 2 +- .../FrontEnd/GetTokens/ILexer.cs | 4 +- .../FrontEnd/GetTokens/Impl/Lexer.cs | 8 +- .../FrontEnd/GetTokens/LexerException.cs | 7 +- .../FrontEnd/TopDownParse/IParser.cs | 4 +- .../FrontEnd/TopDownParse/Impl/Parser.cs | 745 ++++++++++++++++ .../TopDownParse/Impl/TokensStream.cs | 4 +- .../FrontEnd/TopDownParse/ParserException.cs | 9 +- HydraScript.Lib/GlobalUsings.cs | 5 + .../HydraScript.Lib.csproj | 6 +- .../IR/Ast/AbstractSyntaxTreeNode.cs | 79 ++ HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs | 8 + .../IR/Ast/Impl/AbstractSyntaxTree.cs | 63 ++ .../AfterTypesAreLoadedDeclaration.cs | 8 + .../FunctionDeclaration.cs | 63 ++ .../AfterTypesAreLoaded/LexicalDeclaration.cs | 39 + .../Nodes/Declarations/TypeDeclaration.cs | 34 + .../Ast/Impl/Nodes/Declarations/TypeValue.cs | 65 ++ .../AccessExpressions/AccessExpression.cs | 30 + .../AccessExpressions/DotAccess.cs | 34 + .../AccessExpressions/IndexAccess.cs | 33 + .../Nodes/Expressions/AssignmentExpression.cs | 41 + .../Nodes/Expressions/BinaryExpression.cs | 37 + .../Impl/Nodes/Expressions/CallExpression.cs | 45 + .../Nodes/Expressions/CastAsExpression.cs | 33 + .../ComplexLiterals/ArrayLiteral.cs | 27 + .../ComplexLiterals/ComplexLiteral.cs | 8 + .../ComplexLiterals/ObjectLiteral.cs | 27 + .../Expressions/ComplexLiterals/Property.cs | 20 +- .../Expressions/ConditionalExpression.cs | 38 + .../Ast/Impl/Nodes/Expressions/Expression.cs | 13 + .../Expressions/LeftHandSideExpression.cs | 10 + .../Nodes/Expressions/MemberExpression.cs | 62 ++ .../PrimaryExpressions/IdentifierReference.cs | 24 + .../PrimaryExpressions/ImplicitLiteral.cs | 27 + .../Expressions/PrimaryExpressions/Literal.cs | 33 + .../PrimaryExpressions/PrimaryExpression.cs | 18 + .../Impl/Nodes/Expressions/UnaryExpression.cs | 32 + .../IR/Ast/Impl/Nodes/ScriptBody.cs | 33 + .../IR/Ast/Impl/Nodes/StatementListItem.cs | 10 + .../Impl/Nodes/Statements/BlockStatement.cs | 30 + .../Nodes/Statements/ExpressionStatement.cs | 29 + .../Ast/Impl/Nodes/Statements/IfStatement.cs | 51 ++ .../Nodes/Statements/InsideStatementJump.cs | 31 + .../Impl/Nodes/Statements/ReturnStatement.cs | 37 + .../Impl/Nodes/Statements/WhileStatement.cs | 34 + .../Visitors/ExpressionInstructionProvider.cs | 324 +++++++ .../IR/Ast/Visitors/InstructionProvider.cs | 202 +++++ .../Exceptions/ArrayAccessException.cs | 6 +- .../Exceptions/AssignmentToConst.cs | 11 + .../Exceptions/CannotDefineType.cs | 11 + .../Exceptions/ConstWithoutInitializer.cs | 11 + .../Exceptions/DeclarationAlreadyExists.cs | 11 + .../FunctionWithoutReturnStatement.cs | 6 +- .../Exceptions/IncompatibleTypesOfOperands.cs | 6 +- .../Exceptions/NonAccessibleType.cs | 10 + .../Exceptions/NotBooleanTestExpression.cs | 6 +- .../Exceptions/ObjectAccessException.cs | 8 +- .../Exceptions/OutsideOfStatement.cs | 11 + .../Exceptions/ReturnOutsideFunction.cs | 6 +- .../Exceptions/SemanticException.cs | 7 +- .../Exceptions/SymbolIsNotCallable.cs | 11 + .../Exceptions/UnknownIdentifierReference.cs | 11 + .../Exceptions/UnsupportedOperation.cs | 6 +- .../WrongArrayLiteralDeclaration.cs | 6 +- .../Exceptions/WrongAssignmentTarget.cs | 11 + .../Exceptions/WrongConditionalTypes.cs | 6 +- .../Exceptions/WrongNumberOfArguments.cs | 6 +- .../Exceptions/WrongReturnType.cs | 6 +- .../Exceptions/WrongTypeOfArgument.cs | 6 +- .../IR/CheckSemantics/Types/Any.cs | 2 +- .../IR/CheckSemantics/Types/ArrayType.cs | 32 + .../IR/CheckSemantics/Types/NullType.cs | 8 +- .../IR/CheckSemantics/Types/NullableType.cs | 37 + .../IR/CheckSemantics/Types/ObjectType.cs | 188 ++++ .../IR/CheckSemantics/Types/Type.cs | 42 + .../CheckSemantics/Variables/SymbolTable.cs | 41 + .../Variables/Symbols/FunctionSymbol.cs | 35 + .../Variables/Symbols/ObjectSymbol.cs | 14 + .../Variables/Symbols/Symbol.cs | 7 + .../Variables/Symbols/TypeSymbol.cs | 30 + .../Variables/Symbols/VariableSymbol.cs | 11 +- .../Visitors/DeclarationVisitor.cs | 99 +++ .../Visitors/SemanticChecker.cs | 459 ++++++++++ .../IDefaultValueForTypeCalculator.cs | 6 + .../IFunctionWithUndefinedReturnStorage.cs | 15 + .../Services/IJavaScriptTypesProvider.cs | 6 + .../Visitors/Services/IMethodStorage.cs | 11 + .../Services/IStandardLibraryProvider.cs | 8 + .../ISymbolTableInitializerService.cs | 10 + .../Services/ITypeDeclarationsResolver.cs | 10 + .../Impl/DefaultValueForTypeCalculator.cs | 30 + .../FunctionWithUndefinedReturnStorage.cs | 40 + .../Services/Impl/JavaScriptTypesProvider.cs | 16 + .../Visitors/Services/Impl/MethodStorage.cs | 20 + .../Services/Impl/StandardLibraryProvider.cs | 38 + .../Impl/SymbolTableInitializerService.cs | 15 + .../Services/Impl/TypeDeclarationsResolver.cs | 51 ++ .../Visitors/SymbolTableInitializer.cs | 54 ++ .../Visitors/TypeSystemLoader.cs | 55 ++ HydraScript.Tests/GlobalUsings.cs | 3 + HydraScript.Tests/Helpers/ListExtensions.cs | 14 + HydraScript.Tests/Helpers/MockExtensions.cs | 38 + .../HydraScript.Tests.csproj | 8 +- .../Properties/AssemblyInfo.cs | 0 .../Stubs/SemanticExceptionStub.cs | 5 + .../TestData/InstructionsData.cs | 127 +++ .../TestData/LexerData.cs | 2 +- .../TestData/ParserData.cs | 9 +- .../BackEnd/AddressedInstructionsTests.cs | 95 ++ .../Unit/BackEnd/CallTests.cs | 9 +- .../Unit/BackEnd/InstructionsTests.cs | 23 + .../Unit/BackEnd/ValuesTests.cs | 8 +- .../Unit/BackEnd/VirtualMachineTests.cs | 158 ++++ .../Unit/FrontEnd/LexerTests.cs | 10 +- .../Unit/FrontEnd/ParserTests.cs | 12 +- .../Unit/FrontEnd/StructureTests.cs | 6 +- HydraScript.Tests/Unit/IR/AstNodeTests.cs | 31 + ...FunctionWithUndefinedReturnStorageTests.cs | 41 + .../Unit/IR/SymbolTableTests.cs | 12 +- .../Unit/IR/Types/ObjectTypeTests.cs | 43 +- .../Unit/IR/Types/TypeTests.cs | 12 +- .../Unit/Infrastructure/ExecutorTests.cs | 25 +- .../Infrastructure/LoggingEntitiesTests.cs | 21 +- .../Infrastructure/ParsingServiceTests.cs | 10 +- .../Unit/Infrastructure/ProvidersTests.cs | 19 +- .../CommandLineSettings.cs | 4 +- .../HydraScript.csproj | 6 +- {Interpreter => HydraScript}/Program.cs | 20 +- .../Services/Executor/IExecutor.cs | 2 +- .../Services/Executor/Impl/Executor.cs | 14 +- .../Services/Parsing/IParsingService.cs | 4 +- .../Services/Parsing/Impl/ParsingService.cs | 6 +- .../Providers/LexerProvider/ILexerProvider.cs | 8 + .../LexerProvider/Impl}/LexerProvider.cs | 7 +- .../LexerProvider/Impl}/LoggingLexer.cs | 6 +- .../ParserProvider/IParserProvider.cs | 8 + .../Impl}/LoggingAbstractSyntaxTree.cs | 10 +- .../ParserProvider/Impl}/LoggingParser.cs | 6 +- .../ParserProvider/Impl}/ParserProvider.cs | 7 +- .../StructureProvider/IStructureProvider.cs | 8 + .../Impl}/StructureProvider.cs | 8 +- {Interpreter => HydraScript}/TokenTypes.cs | 7 +- {Interpreter => HydraScript}/grammar.txt | 41 +- .../BackEnd/Instructions/AsString.cs | 53 -- .../BackEnd/Instructions/BeginFunction.cs | 15 - .../BackEnd/Instructions/CallFunction.cs | 47 - .../BackEnd/Instructions/CreateArray.cs | 22 - .../BackEnd/Instructions/CreateObject.cs | 20 - .../BackEnd/Instructions/DotAssignment.cs | 23 - Interpreter.Lib/BackEnd/Instructions/Goto.cs | 19 - Interpreter.Lib/BackEnd/Instructions/Halt.cs | 18 - .../BackEnd/Instructions/IfNotGoto.cs | 26 - .../BackEnd/Instructions/IndexAssignment.cs | 23 - .../BackEnd/Instructions/Instruction.cs | 21 - Interpreter.Lib/BackEnd/Instructions/Print.cs | 21 - .../BackEnd/Instructions/PushParameter.cs | 27 - .../BackEnd/Instructions/RemoveFromArray.cs | 26 - .../BackEnd/Instructions/Return.cs | 38 - .../BackEnd/Instructions/Simple.cs | 90 -- Interpreter.Lib/BackEnd/VirtualMachine.cs | 74 -- .../Data/TokenTypes/TokenTypeUtils.cs | 7 - .../FrontEnd/TopDownParse/Impl/Parser.cs | 839 ------------------ Interpreter.Lib/GlobalUsings.cs | 3 - Interpreter.Lib/IR/Ast/IAbstractSyntaxTree.cs | 8 - .../IR/Ast/Impl/AbstractSyntaxTree.cs | 64 -- .../IR/Ast/Nodes/AbstractSyntaxTreeNode.cs | 73 -- .../IR/Ast/Nodes/Declarations/Declaration.cs | 6 - .../Nodes/Declarations/FunctionDeclaration.cs | 84 -- .../Nodes/Declarations/LexicalDeclaration.cs | 63 -- .../AccessExpressions/AccessExpression.cs | 33 - .../AccessExpressions/DotAccess.cs | 62 -- .../AccessExpressions/IndexAccess.cs | 68 -- .../Nodes/Expressions/AssignmentExpression.cs | 183 ---- .../Ast/Nodes/Expressions/BinaryExpression.cs | 209 ----- .../Ast/Nodes/Expressions/CallExpression.cs | 195 ---- .../Ast/Nodes/Expressions/CastAsExpression.cs | 52 -- .../ComplexLiterals/ArrayLiteral.cs | 73 -- .../ComplexLiterals/ObjectLiteral.cs | 83 -- .../Expressions/ConditionalExpression.cs | 88 -- .../IR/Ast/Nodes/Expressions/Expression.cs | 15 - .../Ast/Nodes/Expressions/MemberExpression.cs | 70 -- .../PrimaryExpressions/IdentifierReference.cs | 36 - .../Expressions/PrimaryExpressions/Literal.cs | 25 - .../PrimaryExpressions/PrimaryExpression.cs | 20 - .../Ast/Nodes/Expressions/UnaryExpression.cs | 89 -- Interpreter.Lib/IR/Ast/Nodes/ScriptBody.cs | 16 - .../IR/Ast/Nodes/StatementListItem.cs | 8 - .../IR/Ast/Nodes/Statements/BlockStatement.cs | 51 -- .../IR/Ast/Nodes/Statements/BreakStatement.cs | 14 - .../Ast/Nodes/Statements/ContinueStatement.cs | 14 - .../Nodes/Statements/ExpressionStatement.cs | 24 - .../IR/Ast/Nodes/Statements/IfStatement.cs | 126 --- .../Nodes/Statements/InsideLoopStatement.cs | 25 - .../Ast/Nodes/Statements/ReturnStatement.cs | 92 -- .../IR/Ast/Nodes/Statements/Statement.cs | 6 - .../IR/Ast/Nodes/Statements/TypeStatement.cs | 21 - .../IR/Ast/Nodes/Statements/WhileStatement.cs | 91 -- .../Exceptions/AssignmentToConst.cs | 9 - .../Exceptions/CannotDefineType.cs | 9 - .../Exceptions/ConstWithoutInitializer.cs | 9 - .../Exceptions/DeclarationAlreadyExists.cs | 9 - .../Exceptions/OutsideOfLoop.cs | 9 - .../Exceptions/SymbolIsNotCallable.cs | 9 - .../Exceptions/UnknownIdentifierReference.cs | 9 - .../IR/CheckSemantics/Types/ArrayType.cs | 35 - .../IR/CheckSemantics/Types/FunctionType.cs | 56 -- .../IR/CheckSemantics/Types/NullableType.cs | 40 - .../IR/CheckSemantics/Types/ObjectType.cs | 70 -- .../IR/CheckSemantics/Types/Type.cs | 48 - .../IR/CheckSemantics/Types/TypeUtils.cs | 43 - .../Types/Visitors/ObjectTypeHasher.cs | 49 - .../Types/Visitors/ObjectTypePrinter.cs | 75 -- .../Types/Visitors/ReferenceResolver.cs | 75 -- .../CheckSemantics/Variables/SymbolTable.cs | 43 - .../Variables/SymbolTableUtils.cs | 51 -- .../Variables/Symbols/FunctionSymbol.cs | 33 - .../Variables/Symbols/ObjectSymbol.cs | 27 - .../Variables/Symbols/Symbol.cs | 12 - Interpreter.Tests/GlobalUsings.cs | 3 - Interpreter.Tests/MockExtensions.cs | 21 - .../Stubs/SemanticExceptionStub.cs | 5 - .../TestData/InstructionsData.cs | 105 --- .../Unit/BackEnd/FunctionInfoTests.cs | 13 - .../Unit/BackEnd/InstructionsTests.cs | 39 - .../Unit/BackEnd/VirtualMachineTests.cs | 131 --- Interpreter.Tests/Unit/IR/AstNodeTests.cs | 29 - Interpreter.Tests/Unit/IR/ExpressionTests.cs | 22 - .../Services/Providers/ILexerProvider.cs | 8 - .../Services/Providers/IParserProvider.cs | 8 - .../Services/Providers/IStructureProvider.cs | 8 - Readme.md | 18 +- samples/equals.js | 15 +- samples/forwardref.js | 15 + samples/linkedlist.js | 42 +- samples/settable.js | 14 +- samples/summator.js | 14 +- samples/this.js | 17 +- samples/typeresolving.js | 14 + samples/vec2d.js | 3 +- 278 files changed, 5701 insertions(+), 4938 deletions(-) create mode 100644 HydraScript.Lib/BackEnd/AddressedInstructions.cs create mode 100644 HydraScript.Lib/BackEnd/Addresses/HashAddress.cs create mode 100644 HydraScript.Lib/BackEnd/Addresses/IAddress.cs create mode 100644 HydraScript.Lib/BackEnd/Addresses/Label.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/Halt.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/Instruction.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/Print.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/PushParameter.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/Return.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs create mode 100644 HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs rename {Interpreter.Lib => HydraScript.Lib}/BackEnd/Values/Constant.cs (81%) rename {Interpreter.Lib => HydraScript.Lib}/BackEnd/Values/IValue.cs (65%) rename {Interpreter.Lib => HydraScript.Lib}/BackEnd/Values/Name.cs (90%) create mode 100644 HydraScript.Lib/BackEnd/VirtualMachine.cs rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/Structure.cs (87%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/Token.cs (93%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs (67%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs (65%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs (74%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs (83%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/ILexer.cs (52%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/Impl/Lexer.cs (89%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/GetTokens/LexerException.cs (66%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/TopDownParse/IParser.cs (50%) create mode 100644 HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/TopDownParse/Impl/TokensStream.cs (85%) rename {Interpreter.Lib => HydraScript.Lib}/FrontEnd/TopDownParse/ParserException.cs (62%) create mode 100644 HydraScript.Lib/GlobalUsings.cs rename Interpreter.Lib/Interpreter.Lib.csproj => HydraScript.Lib/HydraScript.Lib.csproj (58%) create mode 100644 HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs create mode 100644 HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs rename {Interpreter.Lib/IR/Ast => HydraScript.Lib/IR/Ast/Impl}/Nodes/Expressions/ComplexLiterals/Property.cs (59%) create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs create mode 100644 HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs create mode 100644 HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs create mode 100644 HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/ArrayAccessException.cs (57%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs (57%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs (57%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs (55%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/ObjectAccessException.cs (51%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs (50%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/SemanticException.cs (68%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs (56%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs (60%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs (63%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs (58%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongReturnType.cs (56%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs (57%) rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Types/Any.cs (78%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Types/NullType.cs (50%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Types/Type.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs rename {Interpreter.Lib => HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs (56%) create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs create mode 100644 HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs create mode 100644 HydraScript.Tests/GlobalUsings.cs create mode 100644 HydraScript.Tests/Helpers/ListExtensions.cs create mode 100644 HydraScript.Tests/Helpers/MockExtensions.cs rename Interpreter.Tests/Interpreter.Tests.csproj => HydraScript.Tests/HydraScript.Tests.csproj (87%) rename {Interpreter.Tests => HydraScript.Tests}/Properties/AssemblyInfo.cs (100%) create mode 100644 HydraScript.Tests/Stubs/SemanticExceptionStub.cs create mode 100644 HydraScript.Tests/TestData/InstructionsData.cs rename {Interpreter.Tests => HydraScript.Tests}/TestData/LexerData.cs (95%) rename {Interpreter.Tests => HydraScript.Tests}/TestData/ParserData.cs (52%) create mode 100644 HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs rename {Interpreter.Tests => HydraScript.Tests}/Unit/BackEnd/CallTests.cs (50%) create mode 100644 HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs rename {Interpreter.Tests => HydraScript.Tests}/Unit/BackEnd/ValuesTests.cs (83%) create mode 100644 HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs rename {Interpreter.Tests => HydraScript.Tests}/Unit/FrontEnd/LexerTests.cs (84%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/FrontEnd/ParserTests.cs (66%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/FrontEnd/StructureTests.cs (80%) create mode 100644 HydraScript.Tests/Unit/IR/AstNodeTests.cs create mode 100644 HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs rename {Interpreter.Tests => HydraScript.Tests}/Unit/IR/SymbolTableTests.cs (83%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/IR/Types/ObjectTypeTests.cs (73%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/IR/Types/TypeTests.cs (68%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/Infrastructure/ExecutorTests.cs (81%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/Infrastructure/LoggingEntitiesTests.cs (84%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/Infrastructure/ParsingServiceTests.cs (77%) rename {Interpreter.Tests => HydraScript.Tests}/Unit/Infrastructure/ProvidersTests.cs (77%) rename {Interpreter => HydraScript}/CommandLineSettings.cs (94%) rename Interpreter/Interpreter.csproj => HydraScript/HydraScript.csproj (86%) rename {Interpreter => HydraScript}/Program.cs (72%) rename {Interpreter => HydraScript}/Services/Executor/IExecutor.cs (55%) rename {Interpreter => HydraScript}/Services/Executor/Impl/Executor.cs (74%) rename {Interpreter => HydraScript}/Services/Parsing/IParsingService.cs (53%) rename {Interpreter => HydraScript}/Services/Parsing/Impl/ParsingService.cs (74%) create mode 100644 HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs rename {Interpreter/Services/Providers/Impl/LexerProvider => HydraScript/Services/Providers/LexerProvider/Impl}/LexerProvider.cs (77%) rename {Interpreter/Services/Providers/Impl/LexerProvider => HydraScript/Services/Providers/LexerProvider/Impl}/LoggingLexer.cs (83%) create mode 100644 HydraScript/Services/Providers/ParserProvider/IParserProvider.cs rename {Interpreter/Services/Providers/Impl/ParserProvider => HydraScript/Services/Providers/ParserProvider/Impl}/LoggingAbstractSyntaxTree.cs (70%) rename {Interpreter/Services/Providers/Impl/ParserProvider => HydraScript/Services/Providers/ParserProvider/Impl}/LoggingParser.cs (83%) rename {Interpreter/Services/Providers/Impl/ParserProvider => HydraScript/Services/Providers/ParserProvider/Impl}/ParserProvider.cs (76%) create mode 100644 HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs rename {Interpreter/Services/Providers/Impl/StructureProvider => HydraScript/Services/Providers/StructureProvider/Impl}/StructureProvider.cs (87%) rename {Interpreter => HydraScript}/TokenTypes.cs (95%) rename {Interpreter => HydraScript}/grammar.txt (69%) delete mode 100644 Interpreter.Lib/BackEnd/Instructions/AsString.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/BeginFunction.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/CallFunction.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/CreateArray.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/CreateObject.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/DotAssignment.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Goto.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Halt.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/IfNotGoto.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/IndexAssignment.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Instruction.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Print.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/PushParameter.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/RemoveFromArray.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Return.cs delete mode 100644 Interpreter.Lib/BackEnd/Instructions/Simple.cs delete mode 100644 Interpreter.Lib/BackEnd/VirtualMachine.cs delete mode 100644 Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenTypeUtils.cs delete mode 100644 Interpreter.Lib/FrontEnd/TopDownParse/Impl/Parser.cs delete mode 100644 Interpreter.Lib/GlobalUsings.cs delete mode 100644 Interpreter.Lib/IR/Ast/IAbstractSyntaxTree.cs delete mode 100644 Interpreter.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/AbstractSyntaxTreeNode.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Declarations/Declaration.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Declarations/FunctionDeclaration.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Declarations/LexicalDeclaration.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/AssignmentExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/BinaryExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/CallExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/CastAsExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/ConditionalExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/Expression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/MemberExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Expressions/UnaryExpression.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/ScriptBody.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/StatementListItem.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/BlockStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/BreakStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/ContinueStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/ExpressionStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/IfStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/InsideLoopStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/ReturnStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/Statement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/TypeStatement.cs delete mode 100644 Interpreter.Lib/IR/Ast/Nodes/Statements/WhileStatement.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/OutsideOfLoop.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/ArrayType.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/FunctionType.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/NullableType.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/ObjectType.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/Type.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/TypeUtils.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypeHasher.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypePrinter.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ReferenceResolver.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTable.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTableUtils.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs delete mode 100644 Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs delete mode 100644 Interpreter.Tests/GlobalUsings.cs delete mode 100644 Interpreter.Tests/MockExtensions.cs delete mode 100644 Interpreter.Tests/Stubs/SemanticExceptionStub.cs delete mode 100644 Interpreter.Tests/TestData/InstructionsData.cs delete mode 100644 Interpreter.Tests/Unit/BackEnd/FunctionInfoTests.cs delete mode 100644 Interpreter.Tests/Unit/BackEnd/InstructionsTests.cs delete mode 100644 Interpreter.Tests/Unit/BackEnd/VirtualMachineTests.cs delete mode 100644 Interpreter.Tests/Unit/IR/AstNodeTests.cs delete mode 100644 Interpreter.Tests/Unit/IR/ExpressionTests.cs delete mode 100644 Interpreter/Services/Providers/ILexerProvider.cs delete mode 100644 Interpreter/Services/Providers/IParserProvider.cs delete mode 100644 Interpreter/Services/Providers/IStructureProvider.cs create mode 100644 samples/forwardref.js create mode 100644 samples/typeresolving.js diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml index 471d51ee..90c08059 100644 --- a/.github/workflows/cla.yml +++ b/.github/workflows/cla.yml @@ -23,7 +23,7 @@ jobs: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} with: path-to-signatures: 'signatures.json' - path-to-document: 'https://github.com/Stepami/extended-js-subset/blob/master/contributor-licence-agreement.md' + path-to-document: 'https://github.com/Stepami/hydrascript/blob/master/contributor-licence-agreement.md' allowlist: Stepami,bot* branch: 'main' remote-repository-name: hydrascript-cla-signatures \ No newline at end of file diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 3d9d44dd..03815244 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -14,13 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: 7.0.x - name: Cache NuGet packages - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*') }} @@ -36,9 +36,9 @@ jobs: if: github.event_name == 'pull_request' uses: 5monkeys/cobertura-action@master with: - path: ./Interpreter.Tests/coverage.cobertura.xml + path: ./HydraScript.Tests/coverage.cobertura.xml repo_token: ${{ secrets.GITHUB_TOKEN }} - minimum_coverage: 80 + minimum_coverage: 20 fail_below_threshold: true show_class_names: true show_missing: true @@ -49,7 +49,7 @@ jobs: if: github.ref == 'refs/heads/master' && github.event_name == 'push' uses: irongut/CodeCoverageSummary@v1.3.0 with: - filename: ./Interpreter.Tests/coverage.cobertura.xml + filename: ./HydraScript.Tests/coverage.cobertura.xml badge: true fail_below_min: false format: markdown @@ -57,13 +57,13 @@ jobs: hide_complexity: true thresholds: '80 100' - name: ReportGenerator - uses: danielpalme/ReportGenerator-GitHub-Action@5.1.10 + uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 with: - reports: './Interpreter.Tests/coverage.cobertura.xml' + reports: './HydraScript.Tests/coverage.cobertura.xml' targetdir: './coverage-report' - name: Upload coverage report artifact if: github.event_name == 'push' - uses: actions/upload-artifact@v2.2.3 + uses: actions/upload-artifact@v4 with: name: CoverageReport path: coverage-report diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f16a1013..8a2b937e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create release id: create_release uses: ncipollo/release-action@v1 @@ -38,21 +38,21 @@ jobs: runs-on: ${{ matrix.config.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: 7.0.x - name: Publish run: | mkdir output - dotnet publish ./Interpreter/Interpreter.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output + dotnet publish ./HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output - name: Upload release assets uses: shogo82148/actions-upload-release-asset@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_name: interpreter-${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} - asset_path: ./output/Interpreter${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} + asset_name: hydrascript-${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} + asset_path: ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} asset_content_type: ${{ matrix.config.type }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e67a471..0908662d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ Contributions are welcomed! Here's a few things to know: ## Steps to Contributing Here are the basic steps to get started with your first contribution. Please reach out with any questions. -1. Use [open issues](https://github.com/stepami/extended-js-subset/issues) to discuss the proposed changes. Create an issue describing changes if necessary to collect feedback. Also, please use provided labels to tag issues so everyone can easily sort issues of interest. +1. Use [open issues](https://github.com/stepami/hydrascript/issues) to discuss the proposed changes. Create an issue describing changes if necessary to collect feedback. Also, please use provided labels to tag issues so everyone can easily sort issues of interest. 1. [Fork the repo](https://help.github.com/articles/fork-a-repo/) in order if you want to make and test local changes. 1. Create a new branch **from master** for the issue. We suggest prefixing the branch with type of contribution (`bugfix`/`feature`), your username and then a descriptive title: (e.g. `bugfix/user1/object-comparision` or `feature/user2/variable-initialization-check`) 1. Make code changes. diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index b37528cd..6257864f 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -1,10 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interpreter.Lib", "Interpreter.Lib\Interpreter.Lib.csproj", "{83524079-4A56-4AF0-9011-F7CA871536E9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Lib", "HydraScript.Lib\HydraScript.Lib.csproj", "{83524079-4A56-4AF0-9011-F7CA871536E9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interpreter", "Interpreter\Interpreter.csproj", "{5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript", "HydraScript\HydraScript.csproj", "{5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Interpreter.Tests", "Interpreter.Tests\Interpreter.Tests.csproj", "{F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Tests", "HydraScript.Tests\HydraScript.Tests.csproj", "{F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/HydraScript.Lib/BackEnd/AddressedInstructions.cs b/HydraScript.Lib/BackEnd/AddressedInstructions.cs new file mode 100644 index 00000000..62c4d6fe --- /dev/null +++ b/HydraScript.Lib/BackEnd/AddressedInstructions.cs @@ -0,0 +1,83 @@ +using System.Collections; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; + +namespace HydraScript.Lib.BackEnd; + +public class AddressedInstructions : IEnumerable +{ + private readonly LinkedList _addresses = new(); + private readonly Dictionary> _addressToNode = new(); + private readonly Dictionary, Instruction> _instructions = new(); + + public Instruction this[IAddress address] + { + get => _instructions[_addressToNode[address]]; + private set => _instructions[_addressToNode[address]] = value; + } + + public IAddress Start => + _addresses.First?.Value; + + public IAddress End => + _addresses.Last?.Value; + + public void Add(Instruction instruction, string label = null) + { + IAddress newAddress = label is null + ? new HashAddress(seed: instruction.GetHashCode()) + : new Label(label); + instruction.Address = newAddress; + + AddWithAddress(instruction, newAddress); + } + + public void Replace(Instruction old, Instruction @new) + { + var address = old.Address; + @new.Address = address; + + this[address] = @new; + } + + private void AddWithAddress(Instruction instruction, IAddress newAddress) + { + var last = _addresses.Last; + if (last is not null) + last.Value.Next = newAddress; + + var newNode = _addresses.AddLast(newAddress); + + _addressToNode.Add(newAddress, newNode); + _instructions.Add(newNode, instruction); + } + + public void AddRange(IEnumerable instructions) + { + foreach (var instruction in instructions) + AddWithAddress(instruction, instruction.Address); + } + + public void Remove(Instruction instruction) + { + var address = instruction.Address; + var nodeToRemove = _addressToNode[address]; + + var prev = nodeToRemove.Previous; + if (prev is not null) + { + prev.Value.Next = nodeToRemove.Next?.Value; + } + + _addressToNode.Remove(address); + _instructions.Remove(nodeToRemove); + _addresses.Remove(nodeToRemove); + } + + public IEnumerator GetEnumerator() => + _addresses.Select(address => this[address]) + .GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => + GetEnumerator(); +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs new file mode 100644 index 00000000..a83ef24e --- /dev/null +++ b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs @@ -0,0 +1,29 @@ +namespace HydraScript.Lib.BackEnd.Addresses; + +public class HashAddress : IAddress +{ + private readonly int _seed; + + public IAddress Next { get; set; } + + public HashAddress(int seed) => + _seed = seed; + + public bool Equals(IAddress other) + { + if (other is HashAddress hashed) + return _seed == hashed._seed; + + return false; + } + + public override int GetHashCode() + { + var i1 = _seed ^ 17; + var i2 = 31 * _seed + i1; + + return HashCode.Combine(i1, i2); + } + + public override string ToString() => "\t"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Addresses/IAddress.cs b/HydraScript.Lib/BackEnd/Addresses/IAddress.cs new file mode 100644 index 00000000..df222575 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Addresses/IAddress.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.BackEnd.Addresses; + +public interface IAddress : IEquatable +{ + IAddress Next { get; set; } +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Addresses/Label.cs b/HydraScript.Lib/BackEnd/Addresses/Label.cs new file mode 100644 index 00000000..ae41adde --- /dev/null +++ b/HydraScript.Lib/BackEnd/Addresses/Label.cs @@ -0,0 +1,25 @@ +namespace HydraScript.Lib.BackEnd.Addresses; + +public class Label : IAddress +{ + public string Name { get; } + + public Label(string name) => + Name = name; + + public IAddress Next { get; set; } + + public bool Equals(IAddress other) + { + if (other is Label label) + return Name == label.Name; + + return false; + } + + public override int GetHashCode() => + Name.GetHashCode(); + + public override string ToString() => + $"{Name}:\n\t"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs b/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs new file mode 100644 index 00000000..46c528fb --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs @@ -0,0 +1,48 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public abstract class BlockLabel : Instruction +{ + private readonly BlockPosition _blockPosition; + private readonly BlockType _blockType; + private readonly string _blockId; + + protected BlockLabel(BlockPosition blockPosition, BlockType blockType, string blockId) + { + _blockPosition = blockPosition; + _blockType = blockType; + _blockId = blockId; + } + + public override IAddress Execute(VirtualMachine vm) => + Address.Next; + + protected override string ToStringInternal() => + $"{_blockPosition}{_blockType} {_blockId}"; + + protected enum BlockPosition + { + Begin, + End + } +} + +public enum BlockType +{ + Function, + Loop, + Condition +} + +public class BeginBlock : BlockLabel +{ + public BeginBlock(BlockType blockType, string blockId) : + base(BlockPosition.Begin, blockType, blockId) { } +} + +public class EndBlock : BlockLabel +{ + public EndBlock(BlockType blockType, string blockId) : + base(BlockPosition.End, blockType, blockId) { } +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/Halt.cs b/HydraScript.Lib/BackEnd/Instructions/Halt.cs new file mode 100644 index 00000000..b2757935 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/Halt.cs @@ -0,0 +1,16 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public class Halt : Instruction +{ + public override bool End() => true; + + public override IAddress Execute(VirtualMachine vm) + { + vm.Frames.Pop(); + return new HashAddress(seed: 0); + } + + protected override string ToStringInternal() => "End"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/Instruction.cs b/HydraScript.Lib/BackEnd/Instructions/Instruction.cs new file mode 100644 index 00000000..e57bdd7b --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/Instruction.cs @@ -0,0 +1,29 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public abstract class Instruction +{ + private IAddress _address; + + public IAddress Address + { + get => _address; + set + { + OnSetOfAddress(value); + _address = value; + } + } + + protected virtual void OnSetOfAddress(IAddress address) { } + + public abstract IAddress Execute(VirtualMachine vm); + + public virtual bool End() => false; + + protected abstract string ToStringInternal(); + + public override string ToString() => + $"{Address}{ToStringInternal()}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/Print.cs b/HydraScript.Lib/BackEnd/Instructions/Print.cs new file mode 100644 index 00000000..7ecafbd8 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/Print.cs @@ -0,0 +1,21 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public class Print : Instruction +{ + private readonly IValue _value; + + public Print(IValue value) => + _value = value; + + public override IAddress Execute(VirtualMachine vm) + { + vm.Writer.WriteLine(_value.Get(vm.Frames.Peek())); + return Address.Next; + } + + protected override string ToStringInternal() => + $"Print {_value}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs b/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs new file mode 100644 index 00000000..0d81cce0 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs @@ -0,0 +1,22 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public class PushParameter : Instruction +{ + private readonly string _parameter; + private readonly IValue _value; + + public PushParameter(string parameter, IValue value) => + (_parameter, _value) = (parameter, value); + + public override IAddress Execute(VirtualMachine vm) + { + vm.Arguments.Push((_parameter, _value.Get(vm.Frames.Peek()))); + return Address.Next; + } + + protected override string ToStringInternal() => + $"PushParameter {_parameter} = {_value}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs b/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs new file mode 100644 index 00000000..0883f60a --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs @@ -0,0 +1,24 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public class RemoveFromArray : Instruction +{ + private readonly string _id; + private readonly IValue _index; + + public RemoveFromArray(string id, IValue index) => + (_id, _index) = (id, index); + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + var list = (List) frame[_id]; + list.RemoveAt(Convert.ToInt32(_index.Get(frame))); + return Address.Next; + } + + protected override string ToStringInternal() => + $"RemoveFrom {_id} at {_index}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/Return.cs b/HydraScript.Lib/BackEnd/Instructions/Return.cs new file mode 100644 index 00000000..352ea780 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/Return.cs @@ -0,0 +1,27 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions; + +public class Return : Instruction +{ + private readonly IValue _value; + + public Return(IValue value = null) => + _value = value; + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Pop(); + var call = vm.CallStack.Pop(); + if (call.Where != null && _value != null) + { + vm.Frames.Peek()[call.Where] = _value.Get(frame); + } + + return frame.ReturnAddress; + } + + protected override string ToStringInternal() => + $"Return{(_value != null ? $" {_value}" : "")}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs new file mode 100644 index 00000000..1a894e37 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs @@ -0,0 +1,32 @@ +using System.Text.Json; +using System.Text.Json.Serialization; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; + +public class AsString : Simple +{ + public AsString(IValue value) : + base(value) { } + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + frame[Left] = JsonSerializer.Serialize( + Right.right.Get(frame), + new JsonSerializerOptions + { + WriteIndented = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + ReferenceHandler = ReferenceHandler.IgnoreCycles, + NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals + } + ); + + return Address.Next; + } + + protected override string ToStringInternal() => + $"{Left} = {Right.right} as string"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs new file mode 100644 index 00000000..93bfe383 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs @@ -0,0 +1,49 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; + +public class CallFunction : Simple +{ + private readonly FunctionInfo _function; + private readonly int _numberOfArguments; + private readonly bool _hasReturnValue; + + public CallFunction( + FunctionInfo function, + int numberOfArguments, + bool hasReturnValue) : + base(null, (null, null), "Call ") + { + _function = function; + _numberOfArguments = numberOfArguments; + _hasReturnValue = hasReturnValue; + } + + protected override void OnSetOfAddress(IAddress address) + { + if (_hasReturnValue) + base.OnSetOfAddress(address); + } + + public override IAddress Execute(VirtualMachine vm) + { + var frame = new Frame(Address.Next, vm.Frames.Peek()); + + var i = 0; + var args = new List<(string Id, object Value)>(); + while (i < _numberOfArguments) + { + args.Add(vm.Arguments.Pop()); + frame[args[i].Id] = args[i].Value; + i++; + } + + vm.CallStack.Push(new Call(Address, _function, args, Left)); + vm.Frames.Push(frame); + return _function.Start; + } + + protected override string ToStringInternal() => Left == null + ? $"Call {_function}, {_numberOfArguments}" + : $"{Left} = Call {_function}, {_numberOfArguments}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs new file mode 100644 index 00000000..66df229b --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs @@ -0,0 +1,22 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; + +public class CreateArray : Simple +{ + private readonly string _id; + private readonly int _size; + + public CreateArray(string id, int size) : base(id) => + (_id, _size) = (id, size); + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + frame[_id] = new object[_size].ToList(); + return Address.Next; + } + + protected override string ToStringInternal() => + $"array {_id} = [{_size}]"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs new file mode 100644 index 00000000..71d5228b --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs @@ -0,0 +1,21 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; + +public class CreateObject : Simple +{ + private readonly string _id; + + public CreateObject(string id) : base(id) => + _id = id; + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + frame[_id] = new Dictionary(); + return Address.Next; + } + + protected override string ToStringInternal() => + $"object {_id} = {{}}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs new file mode 100644 index 00000000..ffac8bac --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs @@ -0,0 +1,29 @@ +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; + +public class DotRead : Simple, IReadFromComplexData +{ + private readonly Name _objectName; + private readonly IValue _property; + + public string Property => (string)_property.Get(frame: null); + + public DotRead(Name @object, IValue property) : base( + leftValue: @object, + binaryOperator: ".", + rightValue: property) + { + _objectName = @object; + _property = property; + } + + public Simple ToAssignment(IValue value) => + new DotAssignment(_objectName.ToString(), _property, value); + + public Instruction ToInstruction() => this; + + protected override string ToStringInternal() => + $"{Left} = {_objectName}.{_property}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs new file mode 100644 index 00000000..e9e0c816 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs @@ -0,0 +1,10 @@ +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; + +public interface IReadFromComplexData +{ + Simple ToAssignment(IValue value); + + Instruction ToInstruction(); +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs new file mode 100644 index 00000000..6f249726 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs @@ -0,0 +1,27 @@ +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; + +public class IndexRead : Simple, IReadFromComplexData +{ + private readonly Name _arrayName; + private readonly IValue _index; + + public IndexRead(Name array, IValue index) : base( + leftValue: array, + binaryOperator: "[]", + rightValue: index) + { + _arrayName = array; + _index = index; + } + + public Simple ToAssignment(IValue value) => + new IndexAssignment(_arrayName.ToString(), _index, value); + + public Instruction ToInstruction() => this; + + protected override string ToStringInternal() => + $"{Left} = {_arrayName}[{_index}]"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs new file mode 100644 index 00000000..de404640 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs @@ -0,0 +1,26 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; + +public class DotAssignment : Simple, IWriteToComplexData +{ + public DotAssignment(string @object, IValue property, IValue value) : + base(left: @object, (property, value), ".") { } + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + var obj = (Dictionary) frame[Left]; + var field = (string) Right.left.Get(frame) ?? string.Empty; + obj[field] = Right.right.Get(frame); + return Address.Next; + } + + public Simple ToSimple() => + new DotRead(new Name(Left), Right.left); + + protected override string ToStringInternal() => + $"{Left}.{Right.left} = {Right.right}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs new file mode 100644 index 00000000..ac1531f1 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; + +public interface IWriteToComplexData +{ + Simple ToSimple(); +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs new file mode 100644 index 00000000..f8acb620 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs @@ -0,0 +1,26 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; + +public class IndexAssignment : Simple, IWriteToComplexData +{ + public IndexAssignment(string array, IValue index, IValue value) : + base(left: array, right: (index, value), "[]") { } + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + var obj = (List) frame[Left]; + var index = Convert.ToInt32(Right.left.Get(frame)); + obj[index] = Right.right.Get(frame); + return Address.Next; + } + + public Simple ToSimple() => + new IndexRead(new Name(Left), Right.left); + + protected override string ToStringInternal() => + $"{Left}[{Right.left}] = {Right.right}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs new file mode 100644 index 00000000..fd1ae75b --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs @@ -0,0 +1,101 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; + +public class Simple : Instruction +{ + public string Left { get; set; } + + protected readonly (IValue left, IValue right) Right; + private readonly string _operator; + + protected Simple(string left) => Left = left; + + public Simple( + string left, + (IValue left, IValue right) right, + string @operator) + { + Left = left; + Right = right; + _operator = @operator; + } + + public Simple(IValue value) : this( + left: null, + right: (null, value), + @operator: string.Empty) + { + } + + public Simple(string unaryOperator, IValue value) : this( + left: null, + right: (null, value), + @operator: unaryOperator) + { + } + + public Simple( + IValue leftValue, + string binaryOperator, + IValue rightValue) : + this( + left: null, + right: (leftValue, rightValue), + @operator: binaryOperator) + { + } + + protected override void OnSetOfAddress(IAddress address) => + Left ??= $"_t{unchecked((uint)address.GetHashCode())}"; + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + if (Right.left == null) + { + var value = Right.right.Get(frame); + frame[Left] = _operator switch + { + "-" => -Convert.ToDouble(value), + "!" => !Convert.ToBoolean(value), + "~" => ((List)value).Count, + "" => value, + _ => throw new NotSupportedException($"_operator {_operator} is not supported") + }; + } + else + { + object lValue = Right.left.Get(frame), rValue = Right.right.Get(frame); + frame[Left] = _operator switch + { + "+" when lValue is string => lValue.ToString() + rValue, + "+" => Convert.ToDouble(lValue) + Convert.ToDouble(rValue), + "-" => Convert.ToDouble(lValue) - Convert.ToDouble(rValue), + "*" => Convert.ToDouble(lValue) * Convert.ToDouble(rValue), + "/" => Convert.ToDouble(lValue) / Convert.ToDouble(rValue), + "%" => Convert.ToDouble(lValue) % Convert.ToDouble(rValue), + "||" => Convert.ToBoolean(lValue) || Convert.ToBoolean(rValue), + "&&" => Convert.ToBoolean(lValue) && Convert.ToBoolean(rValue), + "==" => Equals(lValue, rValue), + "!=" => !Equals(lValue, rValue), + ">" => Convert.ToDouble(lValue) > Convert.ToDouble(rValue), + ">=" => Convert.ToDouble(lValue) >= Convert.ToDouble(rValue), + "<" => Convert.ToDouble(lValue) < Convert.ToDouble(rValue), + "<=" => Convert.ToDouble(lValue) <= Convert.ToDouble(rValue), + "." => ((Dictionary)lValue)[rValue.ToString()!], + "[]" => ((List)lValue)[Convert.ToInt32(rValue)], + "++" => ((List)lValue).Concat((List)rValue).ToList(), + _ => throw new NotSupportedException($"_operator {_operator} is not supported") + }; + } + + return Address.Next; + } + + protected override string ToStringInternal() => + Right.left == null + ? $"{Left} = {_operator}{Right.right}" + : $"{Left} = {Right.left} {_operator} {Right.right}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs new file mode 100644 index 00000000..78537886 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs @@ -0,0 +1,31 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd.Instructions.WithJump; + +public class Goto : Instruction +{ + protected Label jump; + + public InsideStatementJumpType? JumpType { get; } + + public Goto(Label jump) => + this.jump = jump; + + public Goto(InsideStatementJumpType jumpType) => + JumpType = jumpType; + + public override IAddress Execute(VirtualMachine vm) => + jump; + + public void SetJump(Label newJump) => + jump = newJump; + + protected override string ToStringInternal() => + $"Goto {jump.Name}"; +} + +public enum InsideStatementJumpType +{ + Break, + Continue +} \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs b/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs new file mode 100644 index 00000000..d3580220 --- /dev/null +++ b/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs @@ -0,0 +1,24 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Lib.BackEnd.Instructions.WithJump; + +public class IfNotGoto : Goto +{ + private readonly IValue _test; + + public IfNotGoto(IValue test, Label jump) : + base(jump) => + _test = test; + + public override IAddress Execute(VirtualMachine vm) + { + var frame = vm.Frames.Peek(); + return !Convert.ToBoolean(_test.Get(frame)) + ? jump + : Address.Next; + } + + protected override string ToStringInternal() => + $"IfNot {_test} Goto {jump.Name}"; +} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Values/Constant.cs b/HydraScript.Lib/BackEnd/Values/Constant.cs similarity index 81% rename from Interpreter.Lib/BackEnd/Values/Constant.cs rename to HydraScript.Lib/BackEnd/Values/Constant.cs index bba39f9b..f89fb9a1 100644 --- a/Interpreter.Lib/BackEnd/Values/Constant.cs +++ b/HydraScript.Lib/BackEnd/Values/Constant.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd.Values; public class Constant : IValue { @@ -11,6 +11,9 @@ public Constant(object value, string representation) _representation = representation; } + public Constant(object value) : + this(value, value.ToString()) { } + public object Get(Frame frame) => _value; public override string ToString() => _representation; diff --git a/Interpreter.Lib/BackEnd/Values/IValue.cs b/HydraScript.Lib/BackEnd/Values/IValue.cs similarity index 65% rename from Interpreter.Lib/BackEnd/Values/IValue.cs rename to HydraScript.Lib/BackEnd/Values/IValue.cs index 11bd4a39..15fd3c21 100644 --- a/Interpreter.Lib/BackEnd/Values/IValue.cs +++ b/HydraScript.Lib/BackEnd/Values/IValue.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd.Values; public interface IValue : IEquatable { diff --git a/Interpreter.Lib/BackEnd/Values/Name.cs b/HydraScript.Lib/BackEnd/Values/Name.cs similarity index 90% rename from Interpreter.Lib/BackEnd/Values/Name.cs rename to HydraScript.Lib/BackEnd/Values/Name.cs index 9558c340..ba6ad82d 100644 --- a/Interpreter.Lib/BackEnd/Values/Name.cs +++ b/HydraScript.Lib/BackEnd/Values/Name.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd.Values; public class Name : IValue { diff --git a/HydraScript.Lib/BackEnd/VirtualMachine.cs b/HydraScript.Lib/BackEnd/VirtualMachine.cs new file mode 100644 index 00000000..95796bcf --- /dev/null +++ b/HydraScript.Lib/BackEnd/VirtualMachine.cs @@ -0,0 +1,67 @@ +using HydraScript.Lib.BackEnd.Addresses; + +namespace HydraScript.Lib.BackEnd; + +public record VirtualMachine( + Stack CallStack, Stack Frames, + Stack<(string Id, object Value)> Arguments, + TextWriter Writer +) +{ + public VirtualMachine() : + this(new(), new(), new(), Console.Out) { } + + public void Run(AddressedInstructions instructions) + { + Frames.Push(new Frame(instructions.Start)); + + var address = instructions.Start; + while (!instructions[address].End()) + { + var instruction = instructions[address]; + var jump = instruction.Execute(this); + address = jump; + } + + instructions[address].Execute(this); + } +} + +public record Call( + IAddress From, FunctionInfo To, + List<(string Id, object Value)> Parameters, + string Where = null) +{ + public override string ToString() => + $"{From} => {To.Start}: {To.Id}({string.Join(", ", Parameters.Select(x => $"{x.Id}: {x.Value}"))})"; +} + +public record FunctionInfo(string Id) +{ + public Label Start => + new($"Start_{this}"); + + public Label End => + new($"End_{this}"); + + public override string ToString() => Id; +} + +public class Frame +{ + private readonly Dictionary _variables = new(); + private readonly Frame _parentFrame; + + public IAddress ReturnAddress { get; } + + public Frame(IAddress returnAddress, Frame parentFrame = null) => + (ReturnAddress, _parentFrame) = (returnAddress, parentFrame); + + public object this[string id] + { + get => _variables.TryGetValue(id, out var value) + ? value + : _parentFrame?[id]; + set => _variables[id] = value; + } +} \ No newline at end of file diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/Structure.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs similarity index 87% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/Structure.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs index 04a5f964..7e0a1b03 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/Structure.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs @@ -2,9 +2,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text; using System.Text.RegularExpressions; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -namespace Interpreter.Lib.FrontEnd.GetTokens.Data; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data; public class Structure : IEnumerable { @@ -12,8 +12,8 @@ public Structure(List types) { types.AddRange(new List { - TokenTypeUtils.End, - TokenTypeUtils.Error + new EndOfProgramType(), + new ErrorType() }); types = types .OrderBy(t => t.Priority) diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/Token.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs similarity index 93% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/Token.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs index 0da227fd..6906132f 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/Token.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs @@ -1,8 +1,8 @@ using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -namespace Interpreter.Lib.FrontEnd.GetTokens.Data; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data; [ExcludeFromCodeCoverage] public record Token(TokenType Type) diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs similarity index 67% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs index bccc907b..a23c7a9d 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; internal record EndOfProgramType() : TokenType("EOP", "", int.MaxValue - 1) { diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs similarity index 65% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs index da510a76..d76f0128 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; internal record ErrorType() : TokenType("ERROR", @"\S+", int.MaxValue) { diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs similarity index 74% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs index 60a3ca59..20532502 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; public record IgnorableType(string Tag = null, string Pattern = null, int Priority = 0) : TokenType(Tag, Pattern, Priority) diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs similarity index 83% rename from Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs index aacd802f..d14c21cd 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; public record TokenType(string Tag, string Pattern, int Priority) { diff --git a/Interpreter.Lib/FrontEnd/GetTokens/ILexer.cs b/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs similarity index 52% rename from Interpreter.Lib/FrontEnd/GetTokens/ILexer.cs rename to HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs index 902d7318..eef28abe 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/ILexer.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs @@ -1,6 +1,6 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.FrontEnd.GetTokens; +namespace HydraScript.Lib.FrontEnd.GetTokens; public interface ILexer { diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Impl/Lexer.cs b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs similarity index 89% rename from Interpreter.Lib/FrontEnd/GetTokens/Impl/Lexer.cs rename to HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs index 224749a7..6e0dbc1c 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/Impl/Lexer.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs @@ -1,10 +1,10 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -namespace Interpreter.Lib.FrontEnd.GetTokens.Impl; +namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; public class Lexer : ILexer, IEnumerable { @@ -58,7 +58,7 @@ public IEnumerator GetEnumerator() } } - yield return new Token(TokenTypeUtils.End); + yield return new Token(new EndOfProgramType()); } [ExcludeFromCodeCoverage] diff --git a/Interpreter.Lib/FrontEnd/GetTokens/LexerException.cs b/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs similarity index 66% rename from Interpreter.Lib/FrontEnd/GetTokens/LexerException.cs rename to HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs index c6ff2439..28b42e20 100644 --- a/Interpreter.Lib/FrontEnd/GetTokens/LexerException.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs @@ -1,8 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.FrontEnd.GetTokens; +namespace HydraScript.Lib.FrontEnd.GetTokens; -[Serializable] +[Serializable, ExcludeFromCodeCoverage] public class LexerException : Exception { public LexerException() { } diff --git a/Interpreter.Lib/FrontEnd/TopDownParse/IParser.cs b/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs similarity index 50% rename from Interpreter.Lib/FrontEnd/TopDownParse/IParser.cs rename to HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs index 4ab21651..261ba4d0 100644 --- a/Interpreter.Lib/FrontEnd/TopDownParse/IParser.cs +++ b/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs @@ -1,6 +1,6 @@ -using Interpreter.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast; -namespace Interpreter.Lib.FrontEnd.TopDownParse; +namespace HydraScript.Lib.FrontEnd.TopDownParse; public interface IParser { diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs new file mode 100644 index 00000000..7ed8db15 --- /dev/null +++ b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs @@ -0,0 +1,745 @@ +using System.Globalization; +using System.Text.RegularExpressions; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast.Impl; +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +namespace HydraScript.Lib.FrontEnd.TopDownParse.Impl; + +public class Parser : IParser +{ + private TokensStream _tokens; + private readonly ILexer _lexer; + + public Parser(ILexer lexer) => + _lexer = lexer; + + public IAbstractSyntaxTree TopDownParse(string text) + { + _tokens = _lexer.GetTokens(text); + + var root = Script(); + Expect("EOP"); + return new AbstractSyntaxTree(root); + } + + private Token Expect(string expectedTag, string expectedValue = null) + { + var current = _tokens.Current; + + if (!CurrentIs(expectedTag)) + throw new ParserException(_tokens.Current!.Segment, expectedTag, _tokens.Current); + if (_tokens.Current!.Value != (expectedValue ?? _tokens.Current.Value)) + throw new ParserException(_tokens.Current.Segment, expectedValue, _tokens.Current); + + _tokens.MoveNext(); + return current; + } + + private bool CurrentIs(string tag) => + _tokens.Current!.Type == _lexer.Structure.FindByTag(tag); + + private bool CurrentIsLiteral() => + CurrentIs("NullLiteral") || + CurrentIs("IntegerLiteral") || + CurrentIs("FloatLiteral") || + CurrentIs("StringLiteral") || + CurrentIs("BooleanLiteral"); + + private bool CurrentIsKeyword(string keyword) => + CurrentIs("Keyword") && + _tokens.Current!.Value == keyword; + + private bool CurrentIsOperator(string @operator) => + CurrentIs("Operator") && + _tokens.Current!.Value == @operator; + + private ScriptBody Script() => + new(StatementList()); + + private IEnumerable StatementList() + { + var statementList = new List(); + while ( + CurrentIsKeyword("function") || CurrentIsKeyword("let") || CurrentIsKeyword("const") || + CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || + CurrentIsOperator("-") || CurrentIsOperator("!") || CurrentIsOperator("~") || + CurrentIs("LeftCurl") || CurrentIsKeyword("return") || CurrentIsKeyword("break") || + CurrentIsKeyword("continue") || CurrentIsKeyword("if") || CurrentIsKeyword("while") || + CurrentIsKeyword("type") + ) + { + statementList.Add(StatementListItem()); + } + + return statementList; + } + + private StatementListItem StatementListItem() + { + if (CurrentIsKeyword("function") || CurrentIsKeyword("let") || + CurrentIsKeyword("const") || CurrentIsKeyword("type")) + { + return Declaration(); + } + + return Statement(); + } + + private Statement Statement() + { + if (CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || CurrentIsOperator("-") || + CurrentIsOperator("!") || CurrentIsOperator("~")) + { + return ExpressionStatement(); + } + + if (CurrentIs("LeftCurl")) + { + return BlockStatement(); + } + + if (CurrentIsKeyword("return")) + { + return ReturnStatement(); + } + + if (CurrentIsKeyword("break")) + { + return new InsideStatementJump(InsideStatementJump.Break) + { + Segment = Expect("Keyword", "break").Segment + }; + } + + if (CurrentIsKeyword("continue")) + { + return new InsideStatementJump(InsideStatementJump.Continue) + { + Segment = Expect("Keyword", "continue").Segment + }; + } + + if (CurrentIsKeyword("if")) + { + return IfStatement(); + } + + if (CurrentIsKeyword("while")) + { + return WhileStatement(); + } + + return null; + } + + private BlockStatement BlockStatement() + { + Expect("LeftCurl"); + var block = new BlockStatement(StatementList()); + Expect("RightCurl"); + + return block; + } + + private ExpressionStatement ExpressionStatement() + { + return new(Expression()); + } + + private ReturnStatement ReturnStatement() + { + var ret = Expect("Keyword", "return"); + if (CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen")|| + CurrentIsOperator("-") || CurrentIsOperator("!") || CurrentIsOperator("~") || + CurrentIs("LeftCurl") || CurrentIs("LeftBracket")) + { + return new ReturnStatement(Expression()) { Segment = ret.Segment }; + } + + return new ReturnStatement { Segment = ret.Segment }; + } + + private IfStatement IfStatement() + { + var token = Expect("Keyword", "if"); + Expect("LeftParen"); + var expr = Expression(); + Expect("RightParen"); + var then = Statement(); + if (CurrentIsKeyword("else")) + { + Expect("Keyword", "else"); + var @else = Statement(); + return new IfStatement(expr, then, @else) {Segment = token.Segment}; + } + + return new IfStatement(expr, then) {Segment = token.Segment}; + } + + private WhileStatement WhileStatement() + { + var token = Expect("Keyword", "while"); + Expect("LeftParen"); + var expr = Expression(); + Expect("RightParen"); + var stmt = Statement(); + return new WhileStatement(expr, stmt) {Segment = token.Segment}; + } + + private TypeDeclaration TypeDeclaration() + { + var typeWord = Expect("Keyword", "type"); + var ident = Expect("Ident"); + Expect("Assign"); + var type = TypeValue(); + + var typeId = new IdentifierReference(name: ident.Value) + { Segment = ident.Segment }; + + return new TypeDeclaration(typeId, type) { Segment = typeWord.Segment + ident.Segment }; + } + + private TypeValue TypeValue() + { + if (CurrentIs("Ident")) + { + var ident = Expect("Ident"); + var identType = new TypeIdentValue( + TypeId: new IdentifierReference(name: ident.Value) + { Segment = ident.Segment }); + + return WithSuffix(identType); + } + + if (CurrentIs("LeftCurl")) + { + Expect("LeftCurl"); + var propertyTypes = new List(); + while (CurrentIs("Ident")) + { + var ident = Expect("Ident"); + Expect("Colon"); + var propType = TypeValue(); + propertyTypes.Add( + new PropertyTypeValue( + ident.Value, + propType)); + Expect("SemiColon"); + } + + Expect("RightCurl"); + + return WithSuffix(new ObjectTypeValue(propertyTypes)); + } + + return null; + } + + private TypeValue WithSuffix(TypeValue baseType) + { + var type = baseType; + while (CurrentIs("LeftBracket") || CurrentIs("QuestionMark")) + { + if (CurrentIs("LeftBracket")) + { + Expect("LeftBracket"); + Expect("RightBracket"); + type = new ArrayTypeValue(type); + } + else if (CurrentIs("QuestionMark")) + { + Expect("QuestionMark"); + type = new NullableTypeValue(type); + } + } + + return type; + } + + private Declaration Declaration() + { + if (CurrentIsKeyword("function")) + { + return FunctionDeclaration(); + } + + if (CurrentIsKeyword("let") || CurrentIsKeyword("const")) + { + return LexicalDeclaration(); + } + + if (CurrentIsKeyword("type")) + { + return TypeDeclaration(); + } + + return null; + } + + private FunctionDeclaration FunctionDeclaration() + { + Expect("Keyword", "function"); + var ident = Expect("Ident"); + + Expect("LeftParen"); + var args = new List(); + if (CurrentIs("Ident")) + { + var arg = Expect("Ident").Value; + Expect("Colon"); + var type = TypeValue(); + args.Add(new PropertyTypeValue(arg, type)); + } + + while (CurrentIs("Comma")) + { + Expect("Comma"); + var arg = Expect("Ident").Value; + Expect("Colon"); + var type = TypeValue(); + args.Add(new PropertyTypeValue(arg, type)); + } + + var rp = Expect("RightParen"); + + TypeValue returnType = new TypeIdentValue( + TypeId: new IdentifierReference(name: "undefined") + { Segment = rp.Segment }); + + if (CurrentIs("Colon")) + { + Expect("Colon"); + returnType = TypeValue(); + } + + var name = new IdentifierReference(ident.Value) { Segment = ident.Segment }; + return new FunctionDeclaration(name, returnType, args, BlockStatement()) + { Segment = ident.Segment }; + } + + private LexicalDeclaration LexicalDeclaration() + { + var readOnly = CurrentIsKeyword("const"); + Expect("Keyword", readOnly ? "const" : "let"); + var declaration = new LexicalDeclaration(readOnly); + + AddToDeclaration(declaration); + + while (CurrentIs("Comma")) + { + Expect("Comma"); + AddToDeclaration(declaration); + } + + return declaration; + } + + private void AddToDeclaration(LexicalDeclaration declaration) + { + var ident = Expect("Ident"); + var identRef = new IdentifierReference(ident.Value) { Segment = ident.Segment }; + var assignment = new AssignmentExpression( + new MemberExpression(identRef), + new ImplicitLiteral( + new TypeIdentValue( + new IdentifierReference("undefined")))) + { Segment = ident.Segment }; + + if (CurrentIs("Assign")) + { + var assignSegment = Expect("Assign").Segment; + var expression = Expression(); + assignment = new AssignmentExpression( + new MemberExpression(identRef), expression + ) { Segment = assignSegment }; + } + else if (CurrentIs("Colon")) + { + Expect("Colon"); + var type = TypeValue(); + if (CurrentIs("Assign")) + { + var assignSegment = Expect("Assign").Segment; + var expression = Expression(); + assignment = new AssignmentExpression( + new MemberExpression(identRef), + expression, type + ) { Segment = assignSegment }; + } + else + { + var expression = new ImplicitLiteral(type); + assignment = new AssignmentExpression( + lhs: new MemberExpression(identRef), + expression, + type); + } + } + declaration.AddAssignment(assignment); + } + + private Expression Expression() + { + var expr = CastExpression(); + if (expr is LeftHandSideExpression lhs && CurrentIs("Assign")) + { + var assign = Expect("Assign"); + return new AssignmentExpression(lhs, Expression()) + {Segment = assign.Segment}; + } + return expr; + } + + private Expression CallExpression() + { + var member = MemberExpression(); + if (CurrentIs("LeftParen")) + { + var lp = Expect("LeftParen"); + var expressions = new List(); + if (CurrentIs("Ident") || CurrentIsLiteral() || + CurrentIs("LeftParen") || CurrentIsOperator("-") || + CurrentIsOperator("!") || CurrentIsOperator("~") || + CurrentIs("LeftCurl") || CurrentIs("LeftBracket")) + { + expressions.Add(Expression()); + } + + while (CurrentIs("Comma")) + { + Expect("Comma"); + expressions.Add(Expression()); + } + + Expect("RightParen"); + return new CallExpression(member as MemberExpression, expressions) + { Segment = lp.Segment }; + } + + return member; + } + + private Expression MemberExpression() + { + var primary = PrimaryExpression(); + + if (!CurrentIs("LeftBracket") && !CurrentIs("Dot") && + !CurrentIs("Assign") && !CurrentIs("LeftParen")) + return primary; + + var identRef = primary as IdentifierReference; + var accessChain = new List(); + while (CurrentIs("LeftBracket") || CurrentIs("Dot")) + { + Token access; + if (CurrentIs("LeftBracket")) + { + access = Expect("LeftBracket"); + var lb = access.Segment; + var expr = Expression(); + var rb = Expect("RightBracket").Segment; + accessChain.Add( + new IndexAccess(expr, accessChain.LastOrDefault()) {Segment = lb + rb} + ); + } + else if (CurrentIs("Dot")) + { + access = Expect("Dot"); + var identToken = Expect("Ident"); + var idRef = new IdentifierReference(identToken.Value) + { Segment = identToken.Segment }; + accessChain.Add( + new DotAccess(idRef, accessChain.LastOrDefault()) {Segment = access.Segment} + ); + } + } + + return new MemberExpression( + identRef, + accessChain.FirstOrDefault(), + tail: accessChain.LastOrDefault());; + } + + private Expression CastExpression() + { + var cond = ConditionalExpression(); + if (CurrentIsKeyword("as")) + { + var asKeyword = Expect("Keyword", "as"); + var type = TypeValue(); + return new CastAsExpression(cond, type) {Segment = asKeyword.Segment}; + } + + return cond; + } + + private Expression ConditionalExpression() + { + var test = OrExpression(); + if (CurrentIs("QuestionMark")) + { + Expect("QuestionMark"); + var consequent = Expression(); + Expect("Colon"); + var alternate = Expression(); + return new ConditionalExpression(test, consequent, alternate); + } + + return test; + } + + private Expression OrExpression() + { + var left = AndExpression(); + while (CurrentIsOperator("||")) + { + var op = Expect("Operator"); + var right = AndExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression AndExpression() + { + var left = EqualityExpression(); + while (CurrentIsOperator("&&")) + { + var op = Expect("Operator"); + var right = EqualityExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression EqualityExpression() + { + var left = RelationExpression(); + while (CurrentIsOperator("==") || CurrentIsOperator("!=")) + { + var op = Expect("Operator"); + var right = RelationExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression RelationExpression() + { + var left = AdditiveExpression(); + while (CurrentIsOperator(">") || CurrentIsOperator("<") || CurrentIsOperator(">=") || + CurrentIsOperator("<=")) + { + var op = Expect("Operator"); + var right = AdditiveExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression AdditiveExpression() + { + var left = MultiplicativeExpression(); + while (CurrentIsOperator("+") || CurrentIsOperator("-")) + { + var op = Expect("Operator"); + var right = MultiplicativeExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression MultiplicativeExpression() + { + var left = UnaryExpression(); + while (CurrentIsOperator("*") || CurrentIsOperator("/") || CurrentIsOperator("%") + || CurrentIsOperator("++") || CurrentIsOperator("::")) + { + var op = Expect("Operator"); + var right = UnaryExpression(); + left = new BinaryExpression(left, op.Value, right) + { + Segment = op.Segment + }; + } + + return left; + } + + private Expression UnaryExpression() + { + if (CurrentIsOperator("-") || CurrentIsOperator("!") || CurrentIsOperator("~")) + { + var op = Expect("Operator"); + return new UnaryExpression(op.Value, UnaryExpression()) + { + Segment = op.Segment + }; + } + + return LeftHandSideExpression(); + } + + private Expression LeftHandSideExpression() + { + return CallExpression(); + } + + private Expression PrimaryExpression() + { + if (CurrentIs("LeftParen")) + { + Expect("LeftParen"); + var expr = Expression(); + Expect("RightParen"); + return expr; + } + + if (CurrentIs("Ident")) + { + var ident = Expect("Ident"); + var id = new IdentifierReference(ident.Value) + { + Segment = ident.Segment + }; + + return id; + } + + if (CurrentIsLiteral()) + { + return Literal(); + } + + if (CurrentIs("LeftCurl")) + { + return ObjectLiteral(); + } + + if (CurrentIs("LeftBracket")) + { + return ArrayLiteral(); + } + + return null; + } + + private Literal Literal() + { + var segment = _tokens.Current!.Segment; + if (CurrentIs("StringLiteral")) + { + var str = Expect("StringLiteral"); + return new Literal( + new TypeIdentValue( + TypeId: new IdentifierReference(name: "string") + {Segment = str.Segment}), + value: Regex.Unescape(str.Value.Trim('"')), + segment, + label: str.Value + .Replace(@"\", @"\\") + .Replace(@"""", @"\""")); + } + + return _tokens.Current.Type.Tag switch + { + "NullLiteral" => new Literal( + new TypeIdentValue( + TypeId: new IdentifierReference(name: "null") + { Segment = _tokens.Current.Segment }), + Expect("NullLiteral").Value == "null" ? null : string.Empty, + segment, + label: "null"), + "IntegerLiteral" => new Literal( + new TypeIdentValue( + TypeId: new IdentifierReference(name: "number") + { Segment = _tokens.Current.Segment }), + value: double.Parse(Expect("IntegerLiteral").Value), + segment), + "FloatLiteral" => new Literal( + new TypeIdentValue( + TypeId: new IdentifierReference(name: "number") + { Segment = _tokens.Current.Segment }), + value: double.Parse( + Expect("FloatLiteral").Value, + CultureInfo.InvariantCulture), + segment), + "BooleanLiteral" => new Literal( + new TypeIdentValue( + TypeId: new IdentifierReference(name: "boolean") + { Segment = _tokens.Current.Segment }), + value: bool.Parse(Expect("BooleanLiteral").Value), + segment), + _ => throw new ParserException("There are no more supported literals") + }; + } + + private ObjectLiteral ObjectLiteral() + { + Expect("LeftCurl"); + var properties = new List(); + while (CurrentIs("Ident")) + { + var idToken = Expect("Ident"); + var id = new IdentifierReference(idToken.Value) + { Segment = idToken.Segment }; + + Expect("Colon"); + var expr = Expression(); + properties.Add(new Property(id, expr)); + + Expect("SemiColon"); + } + Expect("RightCurl"); + return new ObjectLiteral(properties); + } + + private ArrayLiteral ArrayLiteral() + { + var lb = Expect("LeftBracket").Segment; + var expressions = new List(); + while (CurrentIs("Ident") || CurrentIsLiteral() || + CurrentIs("LeftParen") || CurrentIsOperator("-") || + CurrentIsOperator("!") || CurrentIsOperator("~") || + CurrentIs("LeftCurl") || CurrentIs("LeftBracket")) + { + expressions.Add(Expression()); + if (!CurrentIs("RightBracket")) + { + Expect("Comma"); + } + } + var rb = Expect("RightBracket").Segment; + return new ArrayLiteral(expressions) {Segment = lb + rb}; + } +} \ No newline at end of file diff --git a/Interpreter.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs similarity index 85% rename from Interpreter.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs rename to HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs index 1c232a29..40ce2af1 100644 --- a/Interpreter.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs +++ b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs @@ -1,7 +1,7 @@ using System.Collections; -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.FrontEnd.TopDownParse.Impl; +namespace HydraScript.Lib.FrontEnd.TopDownParse.Impl; public class TokensStream : IEnumerator { diff --git a/Interpreter.Lib/FrontEnd/TopDownParse/ParserException.cs b/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs similarity index 62% rename from Interpreter.Lib/FrontEnd/TopDownParse/ParserException.cs rename to HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs index 4d9ba3b6..3e0f70a7 100644 --- a/Interpreter.Lib/FrontEnd/TopDownParse/ParserException.cs +++ b/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs @@ -1,13 +1,14 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.FrontEnd.TopDownParse; +namespace HydraScript.Lib.FrontEnd.TopDownParse; -[Serializable] +[Serializable, ExcludeFromCodeCoverage] public class ParserException : Exception { public ParserException() { } - protected ParserException(string message) : base(message) { } + public ParserException(string message) : base(message) { } protected ParserException(string message, Exception inner) : base(message, inner) { } diff --git a/HydraScript.Lib/GlobalUsings.cs b/HydraScript.Lib/GlobalUsings.cs new file mode 100644 index 00000000..bb877fed --- /dev/null +++ b/HydraScript.Lib/GlobalUsings.cs @@ -0,0 +1,5 @@ +// Global using directives + +global using Expression = HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.Expression; +global using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; +global using Visitor.NET; \ No newline at end of file diff --git a/Interpreter.Lib/Interpreter.Lib.csproj b/HydraScript.Lib/HydraScript.Lib.csproj similarity index 58% rename from Interpreter.Lib/Interpreter.Lib.csproj rename to HydraScript.Lib/HydraScript.Lib.csproj index e15b082f..c168c6de 100644 --- a/Interpreter.Lib/Interpreter.Lib.csproj +++ b/HydraScript.Lib/HydraScript.Lib.csproj @@ -6,7 +6,11 @@ - + + + + + diff --git a/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs new file mode 100644 index 00000000..35d651fe --- /dev/null +++ b/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs @@ -0,0 +1,79 @@ +using System.Collections; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast; + +public abstract class AbstractSyntaxTreeNode : IEnumerable, + IVisitable, + IVisitable, + IVisitable, + IVisitable, + IVisitable +{ + public AbstractSyntaxTreeNode Parent { get; set; } + + public SymbolTable SymbolTable { get; set; } + + public Segment Segment { get; init; } + + internal List GetAllNodes() + { + var result = new List + { + this + }; + foreach (var child in this) + { + result.AddRange(child.GetAllNodes()); + } + + return result; + } + + public bool ChildOf() where T : AbstractSyntaxTreeNode + { + var parent = Parent; + while (parent != null) + { + if (parent is T) + { + return true; + } + parent = parent.Parent; + } + + return false; + } + + public abstract IEnumerator GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => + GetEnumerator(); + + #region Visitors + + public virtual Unit Accept(SymbolTableInitializer visitor) => + visitor.Visit(this); + + public virtual Unit Accept(TypeSystemLoader visitor) => + visitor.Visit(this); + + public virtual Unit Accept(DeclarationVisitor visitor) => + visitor.Visit(this); + + public virtual Type Accept(SemanticChecker visitor) => + "undefined"; + + public abstract AddressedInstructions Accept(InstructionProvider visitor); + + #endregion + + protected abstract string NodeRepresentation(); + + public override string ToString() => + $"{GetHashCode()} [label=\"{NodeRepresentation()}\"]"; +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs b/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs new file mode 100644 index 00000000..9657cf9d --- /dev/null +++ b/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.BackEnd; + +namespace HydraScript.Lib.IR.Ast; + +public interface IAbstractSyntaxTree +{ + AddressedInstructions GetInstructions(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs new file mode 100644 index 00000000..3d36f9d0 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs @@ -0,0 +1,63 @@ +using System.Text; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +namespace HydraScript.Lib.IR.Ast.Impl; + +public class AbstractSyntaxTree : IAbstractSyntaxTree +{ + private readonly AbstractSyntaxTreeNode _root; + + private readonly SymbolTableInitializer _symbolTableInitializer; + private readonly TypeSystemLoader _typeSystemLoader; + private readonly DeclarationVisitor _declarationVisitor; + + private readonly SemanticChecker _semanticChecker; + private readonly InstructionProvider _instructionProvider; + + public AbstractSyntaxTree(AbstractSyntaxTreeNode root) + { + _root = root; + var functionStorage = new FunctionWithUndefinedReturnStorage(); + var methodStorage = new MethodStorage(); + + _symbolTableInitializer = new SymbolTableInitializer( + new SymbolTableInitializerService(), + new StandardLibraryProvider( + new JavaScriptTypesProvider())); + _typeSystemLoader = new TypeSystemLoader( + new TypeDeclarationsResolver( + new JavaScriptTypesProvider()), + new JavaScriptTypesProvider()); + _declarationVisitor = new DeclarationVisitor(functionStorage, methodStorage); + + _semanticChecker = new SemanticChecker( + new DefaultValueForTypeCalculator(), + functionStorage, + methodStorage); + _instructionProvider = new InstructionProvider(); + } + + public AddressedInstructions GetInstructions() + { + _root.Accept(_symbolTableInitializer); + _root.Accept(_typeSystemLoader); + _root.Accept(_declarationVisitor); + + _root.Accept(_semanticChecker); + return _root.Accept(_instructionProvider); + } + + public override string ToString() + { + var tree = new StringBuilder("digraph ast {\n"); + _root.GetAllNodes().ForEach(node => + { + tree.Append('\t').Append(node).Append('\n'); + node.ToList().ForEach(child => tree.Append($"\t{node.GetHashCode()}->{child.GetHashCode()}\n")); + }); + return tree.Append("}\n").ToString(); + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs new file mode 100644 index 00000000..4feb4636 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; + +public abstract class AfterTypesAreLoadedDeclaration : Declaration +{ + public abstract override Unit Accept(DeclarationVisitor visitor); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs new file mode 100644 index 00000000..0701a740 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -0,0 +1,63 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; + +public class FunctionDeclaration : AfterTypesAreLoadedDeclaration +{ + private IReadOnlyCollection _returnStatements; + + public IdentifierReference Name { get; } + public TypeValue ReturnTypeValue { get; } + public List Arguments { get; } + public BlockStatement Statements { get; } + + public FunctionDeclaration( + IdentifierReference name, + TypeValue returnTypeValue, + List arguments, + BlockStatement blockStatement) + { + Name = name; + ReturnTypeValue = returnTypeValue; + Arguments = arguments; + + Statements = blockStatement; + Statements.Parent = this; + } + + public bool HasReturnStatement() + { + _returnStatements ??= GetReturnStatements(); + return _returnStatements.Count > 0; + } + + public IReadOnlyCollection GetReturnStatements() => + _returnStatements ??= Statements + .GetAllNodes() + .OfType() + .ToArray(); + + public override IEnumerator GetEnumerator() + { + yield return Statements; + } + + protected override string NodeRepresentation() => + "function " + Name; + + public override Unit Accept(SymbolTableInitializer visitor) => + visitor.Visit(this); + + public override Unit Accept(DeclarationVisitor visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs new file mode 100644 index 00000000..35fe9bea --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs @@ -0,0 +1,39 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; + +public class LexicalDeclaration : AfterTypesAreLoadedDeclaration +{ + public bool ReadOnly { get; } + public List Assignments { get; } + + public LexicalDeclaration(bool readOnly) + { + ReadOnly = readOnly; + Assignments = new(); + } + + public void AddAssignment(AssignmentExpression assignment) + { + assignment.Parent = this; + Assignments.Add(assignment); + } + + public override IEnumerator GetEnumerator() => + Assignments.GetEnumerator(); + + protected override string NodeRepresentation() => + ReadOnly ? "const" : "let"; + + public override Unit Accept(DeclarationVisitor visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs new file mode 100644 index 00000000..bdb8a300 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs @@ -0,0 +1,34 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; + +public class TypeDeclaration : Declaration +{ + private readonly TypeValue _typeValue; + public IdentifierReference TypeId { get; } + + public TypeDeclaration(IdentifierReference typeId, TypeValue typeValue) + { + TypeId = typeId; + _typeValue = typeValue; + } + + public Type BuildType() => + _typeValue.BuildType(SymbolTable); + + public override IEnumerator GetEnumerator() + { + yield break; + } + + protected override string NodeRepresentation() => + $"type {TypeId.Name} = {_typeValue}"; + + public override AddressedInstructions Accept(InstructionProvider visitor) => new(); + + public override Unit Accept(TypeSystemLoader visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs new file mode 100644 index 00000000..bea24412 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs @@ -0,0 +1,65 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; + +public abstract record TypeValue +{ + public abstract Type BuildType(SymbolTable symbolTable); +} + +public record TypeIdentValue( + IdentifierReference TypeId +) : TypeValue +{ + public override Type BuildType(SymbolTable symbolTable) => + symbolTable.FindSymbol(TypeId)?.Type ?? + throw new UnknownIdentifierReference(TypeId); + + public override string ToString() => TypeId; +} + +public record ArrayTypeValue( + TypeValue TypeValue +) : TypeValue +{ + public override Type BuildType(SymbolTable symbolTable) => + new ArrayType(TypeValue.BuildType(symbolTable)); + + public override string ToString() => $"{TypeValue}[]"; +} + +public record NullableTypeValue( + TypeValue TypeValue +) : TypeValue +{ + public override Type BuildType(SymbolTable symbolTable) => + new NullableType(TypeValue.BuildType(symbolTable)); + + public override string ToString() => $"{TypeValue}?"; +} + +public record PropertyTypeValue( + string Key, + TypeValue TypeValue) +{ + public override string ToString() => + $"{Key}: {TypeValue}"; +}; + +public record ObjectTypeValue( + IEnumerable Properties +) : TypeValue +{ + public override Type BuildType(SymbolTable symbolTable) => + new ObjectType( + Properties.Select(x => new PropertyType( + Id: x.Key, + x.TypeValue.BuildType(symbolTable)))); + + public override string ToString() => + $"{{{string.Join(';', Properties)}}}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs new file mode 100644 index 00000000..5be598e5 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs @@ -0,0 +1,30 @@ +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; + +public abstract class AccessExpression : Expression +{ + public AccessExpression Next { get; private set; } + + public AccessExpression Prev => + Parent as AccessExpression; + + public Type ComputedType { get; set; } + + protected AccessExpression(AccessExpression prev) + { + if (prev is not null) + { + Parent = prev; + prev.Next = this; + } + } + + public bool HasNext() => + Next is not null; + + public bool HasPrev() => + Prev is not null; + + public abstract override Type Accept(SemanticChecker visitor); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs new file mode 100644 index 00000000..0263739b --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -0,0 +1,34 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; + +public class DotAccess : AccessExpression +{ + public IdentifierReference Property { get; } + + public DotAccess(IdentifierReference property, AccessExpression prev = null) : base(prev) + { + Property = property; + Property.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Property; + if (HasNext()) + { + yield return Next; + } + } + + protected override string NodeRepresentation() => "."; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs new file mode 100644 index 00000000..3c83762f --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -0,0 +1,33 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; + +public class IndexAccess : AccessExpression +{ + public Expression Index { get; } + + public IndexAccess(Expression index, AccessExpression prev = null) : base(prev) + { + Index = index; + Index.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Index; + if (HasNext()) + { + yield return Next; + } + } + + protected override string NodeRepresentation() => "[]"; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs new file mode 100644 index 00000000..6c959f6e --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs @@ -0,0 +1,41 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class AssignmentExpression : Expression +{ + public LeftHandSideExpression Destination { get; } + public Expression Source { get; } + public TypeValue DestinationType { get; } + + public AssignmentExpression( + LeftHandSideExpression lhs, + Expression source, + TypeValue destinationType = null) + { + Destination = lhs; + lhs.Parent = this; + + Source = source; + source.Parent = this; + + DestinationType = destinationType; + } + + public override IEnumerator GetEnumerator() + { + yield return Destination; + yield return Source; + } + + protected override string NodeRepresentation() => "="; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs new file mode 100644 index 00000000..07be9f14 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs @@ -0,0 +1,37 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class BinaryExpression : Expression +{ + public Expression Left { get; } + public string Operator { get; } + public Expression Right { get; } + + public BinaryExpression(Expression left, string @operator, Expression right) + { + Left = left; + Left.Parent = this; + + Operator = @operator; + + Right = right; + Right.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Left; + yield return Right; + } + + protected override string NodeRepresentation() => Operator; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs new file mode 100644 index 00000000..8dacc95c --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs @@ -0,0 +1,45 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class CallExpression : LeftHandSideExpression +{ + public MemberExpression Member { get; } + public List Parameters { get; } + + public CallExpression(MemberExpression member, IEnumerable expressions) + { + Member = member; + Member.Parent = this; + + Parameters = new List(expressions); + Parameters.ForEach(expr => expr.Parent = this); + } + + public override IdentifierReference Id => + Member.Id; + + public override bool Empty() => + Member.Empty(); + + public override IEnumerator GetEnumerator() + { + var nodes = new List + { + Member + }; + nodes.AddRange(Parameters); + return nodes.GetEnumerator(); + } + + protected override string NodeRepresentation() => "()"; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs new file mode 100644 index 00000000..4ea335d6 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs @@ -0,0 +1,33 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class CastAsExpression : Expression +{ + public Expression Expression { get; } + public TypeValue Cast { get; } + + public CastAsExpression(Expression expression, TypeValue cast) + { + Expression = expression; + Expression.Parent = this; + + Cast = cast; + } + + public override IEnumerator GetEnumerator() + { + yield return Expression; + } + + protected override string NodeRepresentation() => $"as {Cast}"; + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs new file mode 100644 index 00000000..29d7c60d --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs @@ -0,0 +1,27 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; + +public class ArrayLiteral : ComplexLiteral +{ + public List Expressions { get; } + + public ArrayLiteral(IEnumerable expressions) + { + Expressions = new List(expressions); + Expressions.ForEach(expr => expr.Parent = this); + } + + public override IEnumerator GetEnumerator() => + Expressions.GetEnumerator(); + + protected override string NodeRepresentation() => "[]"; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs new file mode 100644 index 00000000..df889c41 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; + +public abstract class ComplexLiteral : Expression +{ + public string Id => Parent is AssignmentExpression assignment + ? assignment.Destination.Id + : $"_t{GetHashCode()}"; +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs new file mode 100644 index 00000000..be97943d --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs @@ -0,0 +1,27 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; + +public class ObjectLiteral : ComplexLiteral +{ + public List Properties { get; } + + public ObjectLiteral(IEnumerable properties) + { + Properties = new List(properties); + Properties.ForEach(prop => prop.Parent = this); + } + + public override IEnumerator GetEnumerator() => + Properties.GetEnumerator(); + + protected override string NodeRepresentation() => "{}"; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/Property.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs similarity index 59% rename from Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/Property.cs rename to HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs index ccd379fe..7b13c7ea 100644 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs @@ -1,13 +1,17 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Visitors; -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.ComplexLiterals; +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; public class Property : Expression { public IdentifierReference Id { get; } public Expression Expression { get; } + public ObjectLiteral Object => + Parent as ObjectLiteral; + public Property(IdentifierReference id, Expression expression) { Id = id; @@ -19,10 +23,10 @@ public Property(IdentifierReference id, Expression expression) public void Deconstruct(out string id, out Expression expr) { - id = Id.Id; + id = Id.Name; expr = Expression; } - + public override IEnumerator GetEnumerator() { yield return Id; @@ -31,8 +35,6 @@ public override IEnumerator GetEnumerator() protected override string NodeRepresentation() => ":"; - public override List ToInstructions(int start, string temp) - { - throw new System.NotImplementedException(); - } + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); } \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs new file mode 100644 index 00000000..620de68b --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs @@ -0,0 +1,38 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class ConditionalExpression : Expression +{ + public Expression Test { get; } + public Expression Consequent { get; } + public Expression Alternate { get; } + + public ConditionalExpression(Expression test, Expression consequent, Expression alternate) + { + Test = test; + Consequent = consequent; + Alternate = alternate; + + Test.Parent = this; + Consequent.Parent = this; + Alternate.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Test; + yield return Consequent; + yield return Alternate; + } + + protected override string NodeRepresentation() => "?:"; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs new file mode 100644 index 00000000..9da02668 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs @@ -0,0 +1,13 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public abstract class Expression : AbstractSyntaxTreeNode, + IVisitable +{ + public abstract AddressedInstructions Accept(ExpressionInstructionProvider visitor); + + public sealed override AddressedInstructions Accept(InstructionProvider visitor) => + throw new NotSupportedException(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs new file mode 100644 index 00000000..b5d289b2 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs @@ -0,0 +1,10 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public abstract class LeftHandSideExpression : Expression +{ + public abstract IdentifierReference Id { get; } + + public abstract bool Empty(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs new file mode 100644 index 00000000..963c2355 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs @@ -0,0 +1,62 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class MemberExpression : LeftHandSideExpression +{ + private readonly IdentifierReference _identifierReference; + + public AccessExpression AccessChain { get; } + public AccessExpression Tail { get; } + + public Type ComputedIdType { get; set; } + + public MemberExpression(IdentifierReference identifierReference) : + this(identifierReference, accessChain: null, tail: null) + { + } + + public MemberExpression( + IdentifierReference identifierReference, + AccessExpression accessChain, + AccessExpression tail) + { + _identifierReference = identifierReference; + _identifierReference.Parent = this; + + AccessChain = accessChain; + if (accessChain is not null) + { + AccessChain.Parent = this; + } + + Tail = tail; + } + + public override IdentifierReference Id => + _identifierReference; + + public override bool Empty() => + AccessChain is null; + + public override IEnumerator GetEnumerator() + { + yield return Id; + if (AccessChain is not null) + { + yield return AccessChain; + } + } + + protected override string NodeRepresentation() => nameof(MemberExpression); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs new file mode 100644 index 00000000..04d99114 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs @@ -0,0 +1,24 @@ +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public class IdentifierReference : PrimaryExpression +{ + public string Name { get; } + + public IdentifierReference(string name) + { + Name = name; + } + + protected override string NodeRepresentation() => Name; + + public override IValue ToValue() => new Name(Name); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public static implicit operator string(IdentifierReference identifierReference) => + identifierReference.Name; +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs new file mode 100644 index 00000000..ec56306e --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs @@ -0,0 +1,27 @@ +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public class ImplicitLiteral : PrimaryExpression +{ + public TypeValue TypeValue { get; } + public object ComputedDefaultValue { private get; set; } + + public ImplicitLiteral(TypeValue typeValue) => + TypeValue = typeValue; + + protected override string NodeRepresentation() => + TypeValue.ToString(); + + public override IValue ToValue() => + new Constant( + ComputedDefaultValue, + ComputedDefaultValue is null + ? "null" + : ComputedDefaultValue.ToString()); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs new file mode 100644 index 00000000..2694cdad --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs @@ -0,0 +1,33 @@ +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public class Literal : PrimaryExpression +{ + private readonly TypeValue _type; + private readonly object _value; + private readonly string _label; + + public Literal( + TypeValue type, + object value, + Segment segment, + string label = null) + { + _type = type; + _label = label ?? value.ToString(); + _value = value; + Segment = segment; + } + + protected override string NodeRepresentation() => _label; + + public override IValue ToValue() => + new Constant(_value, _label); + + public override Type Accept(SemanticChecker visitor) => + _type.BuildType(Parent.SymbolTable); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs new file mode 100644 index 00000000..1ba91197 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs @@ -0,0 +1,18 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.IR.Ast.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public abstract class PrimaryExpression : Expression +{ + public override IEnumerator GetEnumerator() + { + yield break; + } + + public abstract IValue ToValue(); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs new file mode 100644 index 00000000..8b486c90 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs @@ -0,0 +1,32 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +public class UnaryExpression : Expression +{ + public string Operator { get; } + public Expression Expression { get; } + + public UnaryExpression(string @operator, Expression expression) + { + Operator = @operator; + + Expression = expression; + Expression.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Expression; + } + + protected override string NodeRepresentation() => Operator; + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs new file mode 100644 index 00000000..cfd21691 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs @@ -0,0 +1,33 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes; + +public class ScriptBody : AbstractSyntaxTreeNode +{ + public List StatementList { get; } + + public ScriptBody(IEnumerable statementList) + { + StatementList = new List(statementList); + StatementList.ForEach(item => item.Parent = this); + } + + public override IEnumerator GetEnumerator() => + StatementList.GetEnumerator(); + + protected override string NodeRepresentation() => "Script"; + + public override Unit Accept(SymbolTableInitializer visitor) => + visitor.Visit(this); + + public override Unit Accept(TypeSystemLoader visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs new file mode 100644 index 00000000..7c277f50 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs @@ -0,0 +1,10 @@ +namespace HydraScript.Lib.IR.Ast.Impl.Nodes; + +public abstract class StatementListItem : + AbstractSyntaxTreeNode { } + +public abstract class Statement : + StatementListItem { } + +public abstract class Declaration : + StatementListItem { } \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs new file mode 100644 index 00000000..3feaca31 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs @@ -0,0 +1,30 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class BlockStatement : Statement +{ + public List StatementList { get; } + + public BlockStatement(IEnumerable statementList) + { + StatementList = new List(statementList); + StatementList.ForEach(item => item.Parent = this); + } + + public override IEnumerator GetEnumerator() => + StatementList.GetEnumerator(); + + protected override string NodeRepresentation() => "{}"; + + public override Unit Accept(SymbolTableInitializer visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs new file mode 100644 index 00000000..c861c016 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs @@ -0,0 +1,29 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class ExpressionStatement : Statement +{ + public Expression Expression { get; } + + public ExpressionStatement(Expression expression) + { + Expression = expression; + expression.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Expression; + } + + protected override string NodeRepresentation() => nameof(ExpressionStatement); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs new file mode 100644 index 00000000..f9676cd1 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs @@ -0,0 +1,51 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class IfStatement : Statement +{ + public Expression Test { get; } + public Statement Then { get; } + public Statement Else { get; } + + public IfStatement(Expression test, Statement then, Statement @else = null) + { + Test = test; + Test.Parent = this; + + Then = then; + Then.Parent = this; + + if (@else is not null) + { + Else = @else; + Else.Parent = this; + } + } + + public bool Empty() => + !Then.Any() && !HasElseBlock(); + + public bool HasElseBlock() => + Else is not null && Else.Any(); + + public override IEnumerator GetEnumerator() + { + yield return Test; + yield return Then; + if (Else is not null) + { + yield return Else; + } + } + + protected override string NodeRepresentation() => "if"; + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs new file mode 100644 index 00000000..b1517eef --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs @@ -0,0 +1,31 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class InsideStatementJump : Statement +{ + public const string Break = "break"; + public const string Continue = "continue"; + + public string Keyword { get; } + + public InsideStatementJump(string keyword) + { + Keyword = keyword; + } + + public override IEnumerator GetEnumerator() + { + yield break; + } + + protected override string NodeRepresentation() => Keyword; + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs new file mode 100644 index 00000000..3901f690 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs @@ -0,0 +1,37 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class ReturnStatement : Statement +{ + public Expression Expression { get; } + + public ReturnStatement(Expression expression = null) + { + Expression = expression; + if (expression is not null) + { + Expression.Parent = this; + } + } + + public override IEnumerator GetEnumerator() + { + if (Expression is null) + { + yield break; + } + + yield return Expression; + } + + protected override string NodeRepresentation() => "return"; + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs new file mode 100644 index 00000000..4224a763 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs @@ -0,0 +1,34 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +public class WhileStatement : Statement +{ + public Expression Condition { get; } + public Statement Statement { get; } + + public WhileStatement(Expression condition, Statement statement) + { + Condition = condition; + Condition.Parent = this; + + Statement = statement; + Statement.Parent = this; + } + + public override IEnumerator GetEnumerator() + { + yield return Condition; + yield return Statement; + } + + protected override string NodeRepresentation() => "while"; + + public override AddressedInstructions Accept(InstructionProvider visitor) => + visitor.Visit(this); + + public override Type Accept(SemanticChecker visitor) => + visitor.Visit(this); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs new file mode 100644 index 00000000..02faff77 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs @@ -0,0 +1,324 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.Ast.Visitors; + +public class ExpressionInstructionProvider : + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor +{ + public AddressedInstructions Visit(PrimaryExpression visitable) => + new() { new Simple(visitable.ToValue()) }; + + public AddressedInstructions Visit(ArrayLiteral visitable) + { + var arraySize = visitable.Expressions.Count; + + var arrayName = visitable.Id; + var createArray = new CreateArray(arrayName, arraySize); + + var result = new AddressedInstructions { createArray }; + + for (var i = 0; i < arraySize; i++) + { + var expression = visitable.Expressions[i]; + var index = new Constant(i); + + if (expression is PrimaryExpression primary) + result.Add(new IndexAssignment(arrayName, index, primary.ToValue())); + else + { + result.AddRange(expression.Accept(this)); + var last = new Name(result.OfType().Last().Left); + result.Add(new IndexAssignment(arrayName, index, last)); + } + } + + return result; + } + + public AddressedInstructions Visit(ObjectLiteral visitable) + { + var objectId = visitable.Id; + var createObject = new CreateObject(objectId); + + var result = new AddressedInstructions { createObject }; + + result.AddRange(visitable.Properties + .SelectMany(property => + property.Accept(this))); + + return result; + } + + public AddressedInstructions Visit(Property visitable) + { + var objectId = visitable.Object.Id; + + var (id, expression) = visitable; + var propertyId = new Constant(id); + + if (expression is PrimaryExpression primary) + return new AddressedInstructions + { new DotAssignment(objectId, propertyId, primary.ToValue()) }; + + var instructions = expression.Accept(this); + var last = new Name(instructions.OfType().Last().Left); + instructions.Add(new DotAssignment(objectId, propertyId, last)); + + return instructions; + } + + public AddressedInstructions Visit(UnaryExpression visitable) + { + if (visitable.Expression is PrimaryExpression primary) + return new() { new Simple(visitable.Operator, primary.ToValue()) }; + + var result = visitable.Expression.Accept(this); + var last = new Name(result.OfType().Last().Left); + result.Add(new Simple(visitable.Operator, last)); + + return result; + } + + public AddressedInstructions Visit(BinaryExpression visitable) + { + if (visitable.Left is IdentifierReference arr && + visitable.Right is PrimaryExpression primary && + visitable.Operator == "::") + return new AddressedInstructions + { + new RemoveFromArray(arr.Name, primary.ToValue()) + }; + + var result = new AddressedInstructions(); + IValue left, right; + + if (visitable.Left is PrimaryExpression primaryLeft) + left = primaryLeft.ToValue(); + else + { + result.AddRange(visitable.Left.Accept(this)); + left = new Name(result.OfType().Last().Left); + } + + if (visitable.Right is PrimaryExpression primaryRight) + right = primaryRight.ToValue(); + else + { + result.AddRange(visitable.Right.Accept(this)); + right = new Name(result.OfType().Last().Left); + } + + result.Add(new Simple(left, visitable.Operator, right)); + + return result; + } + + public AddressedInstructions Visit(CastAsExpression visitable) + { + if (visitable.Expression is PrimaryExpression primary) + return new() { new AsString(primary.ToValue()) }; + + var result = visitable.Expression.Accept(this); + var last = new Name(result.OfType().Last().Left); + result.Add(new AsString(last)); + + return result; + } + + public AddressedInstructions Visit(ConditionalExpression visitable) + { + var blockId = $"cond_{visitable.GetHashCode()}"; + var startBlockLabel = new Label($"Start_{blockId}"); + var endBlockLabel = new Label($"End_{blockId}"); + + var result = new AddressedInstructions(); + + if (visitable.Test is PrimaryExpression primary) + result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); + else + { + result.AddRange(visitable.Test.Accept(this)); + var last = new Name(result.OfType().Last().Left); + result.Add(new IfNotGoto(last, startBlockLabel)); + } + + result.AddRange(visitable.Consequent.Accept(this)); + var temp = result.OfType().Last().Left; + result.Add(new Goto(endBlockLabel)); + + result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); + result.AddRange(visitable.Alternate.Accept(this)); + result.OfType().Last().Left = temp; + result.Add(new EndBlock(BlockType.Condition, blockId), endBlockLabel.Name); + + result.Add(new Simple(new Name(temp))); + + return result; + } + + public AddressedInstructions Visit(AssignmentExpression visitable) + { + var result = visitable.Source.Accept(this); + if (visitable.Source is AssignmentExpression) + { + var last = result.OfType().Last(); + if (last is IWriteToComplexData assignment) + result.Add(assignment.ToSimple()); + else + result.Add(new Simple(new Name(last.Left))); + } + + if (visitable.Destination.Empty()) + result.OfType().Last().Left = visitable.Destination.Id; + else + { + var last = new Name(result.OfType().Last().Left); + result.AddRange(visitable.Destination.Accept(this)); + var lastRead = result.OfType().Last(); + result.Replace(lastRead.ToInstruction(), lastRead.ToAssignment(last)); + } + + return result; + } + + public AddressedInstructions Visit(MemberExpression visitable) => + visitable.Empty() + ? new AddressedInstructions() + : visitable.Tail.Accept(this); + + public AddressedInstructions Visit(DotAccess visitable) + { + var right = new Constant(visitable.Property.Name); + + if (!visitable.HasPrev() && visitable.Parent is LeftHandSideExpression lhs) + return new AddressedInstructions + { + new DotRead(new Name(lhs.Id), right) + }; + + var result = visitable.Prev.Accept(this); + var left = new Name(result.OfType().Last().Left); + result.Add(new DotRead(left, right)); + + return result; + } + + public AddressedInstructions Visit(IndexAccess visitable) + { + var result = new AddressedInstructions(); + + IValue right; + + if (visitable.Index is PrimaryExpression primary) + right = primary.ToValue(); + else + { + result.AddRange(visitable.Index.Accept(this)); + right = new Name(result.OfType().Last().Left); + } + + if (!visitable.HasPrev() && visitable.Parent is LeftHandSideExpression lhs) + result.Add(new IndexRead(new Name(lhs.Id), right)); + else + { + result.AddRange(visitable.Prev.Accept(this)); + var left = new Name(result.OfType().Last().Left); + result.Add(new IndexRead(left, right)); + } + + return result; + } + + public AddressedInstructions Visit(CallExpression visitable) + { + var methodCall = !visitable.Empty(); + if (visitable.Id.Name is "print" && !methodCall) + { + var param = visitable.Parameters[0]; + + if (param is PrimaryExpression prim) + return new AddressedInstructions { new Print(prim.ToValue()) }; + + var result = param.Accept(this); + var last = new Name(result.OfType().Last().Left); + result.Add(new Print(last)); + + return result; + } + else + { + FunctionSymbol functionSymbol; + AddressedInstructions result = new(); + if (methodCall) + { + var memberInstructions = visitable.Member.Accept(this); + var lastMemberInstruction = (DotRead)memberInstructions[memberInstructions.End]; + memberInstructions.Remove(lastMemberInstruction); + result.AddRange(memberInstructions); + + var methodName = lastMemberInstruction.Property; + functionSymbol = visitable.SymbolTable + .FindSymbol(methodName); + } + else + { + functionSymbol = visitable.SymbolTable + .FindSymbol(visitable.Id); + } + if (functionSymbol.IsEmpty) + return new AddressedInstructions(); + var functionInfo = new FunctionInfo(functionSymbol.Id); + + if (methodCall) + { + var caller = result.Any() ? result.OfType().Last().Left : visitable.Id; + result.Add(new PushParameter(functionSymbol.Parameters[0].Id, new Name(caller))); + } + foreach (var (expr, symbol) in visitable.Parameters + .Zip(functionSymbol.Parameters.ToArray()[(methodCall ? 1 : 0)..])) + { + if (expr is PrimaryExpression primary) + result.Add(new PushParameter(symbol.Id, primary.ToValue())); + else + { + result.AddRange(expr.Accept(this)); + var id = result.OfType().Last().Left; + result.Add(new PushParameter(symbol.Id, new Name(id))); + } + } + + Type @void = "void"; + var hasReturnValue = !functionSymbol.Type.Equals(@void); + result.Add(new CallFunction( + functionInfo, + numberOfArguments: visitable.Parameters.Count + (methodCall ? 1 : 0), + hasReturnValue)); + return result; + } + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs new file mode 100644 index 00000000..8aa90562 --- /dev/null +++ b/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs @@ -0,0 +1,202 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; + +namespace HydraScript.Lib.IR.Ast.Visitors; + +public class InstructionProvider : + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor +{ + private readonly ExpressionInstructionProvider _expressionVisitor = new(); + + public AddressedInstructions Visit(ScriptBody visitable) + { + var result = new AddressedInstructions(); + foreach (var item in visitable.StatementList) + { + result.AddRange(item.Accept(this)); + } + + result.Add(new Halt()); + + return result; + } + + public AddressedInstructions Visit(LexicalDeclaration visitable) + { + var result = new AddressedInstructions(); + foreach (var assignment in visitable.Assignments) + { + result.AddRange(assignment.Accept(_expressionVisitor)); + } + + return result; + } + + public AddressedInstructions Visit(BlockStatement visitable) + { + var result = new AddressedInstructions(); + foreach (var item in visitable.StatementList) + { + result.AddRange(item.Accept(this)); + if (item is ReturnStatement) break; + } + + return result; + } + + public AddressedInstructions Visit(InsideStatementJump visitable) + { + var jumpType = visitable.Keyword switch + { + InsideStatementJump.Break => InsideStatementJumpType.Break, + InsideStatementJump.Continue => InsideStatementJumpType.Continue, + _ => throw new ArgumentOutOfRangeException( + nameof(visitable.Keyword), visitable.Keyword, + "Unsupported keyword inside loop") + }; + + return new() { new Goto(jumpType) }; + } + + public AddressedInstructions Visit(ExpressionStatement visitable) => + visitable.Expression.Accept(_expressionVisitor); + + public AddressedInstructions Visit(ReturnStatement visitable) + { + switch (visitable.Expression) + { + case null: + return new() { new Return() }; + case PrimaryExpression primary: + return new() { new Return(primary.ToValue()) }; + } + + var result = visitable.Expression.Accept(_expressionVisitor); + var last = new Name(result.OfType().Last().Left); + result.Add(new Return(last)); + + return result; + } + + public AddressedInstructions Visit(FunctionDeclaration visitable) + { + if (!visitable.Statements.Any()) + return new(); + + var functionInfo = new FunctionInfo(visitable.Name); + + var result = new AddressedInstructions + { + new Goto(functionInfo.End), + { + new BeginBlock(BlockType.Function, blockId: functionInfo.ToString()), + functionInfo.Start.Name + } + }; + + result.AddRange(visitable.Statements.Accept(this)); + if (!visitable.HasReturnStatement()) + result.Add(new Return()); + + result.Add(new EndBlock(BlockType.Function, blockId: functionInfo.ToString()), functionInfo.End.Name); + + return result; + } + + public AddressedInstructions Visit(WhileStatement visitable) + { + var blockId = $"while_{visitable.GetHashCode()}"; + var startBlockLabel = new Label($"Start_{blockId}"); + var endBlockLabel = new Label($"End_{blockId}"); + + var result = new AddressedInstructions + { + { new BeginBlock(BlockType.Loop, blockId), startBlockLabel.Name } + }; + + if (visitable.Condition is PrimaryExpression primary) + result.Add(new IfNotGoto(primary.ToValue(), endBlockLabel)); + else + { + result.AddRange(visitable.Condition.Accept(_expressionVisitor)); + var last = new Name(result.OfType().Last().Left); + result.Add(new IfNotGoto(last, endBlockLabel)); + } + + result.AddRange(visitable.Statement.Accept(this)); + result.OfType().Where(g => g.JumpType is not null) + .ToList().ForEach(g => + { + // ReSharper disable once SwitchStatementHandlesSomeKnownEnumValuesWithDefault + switch (g.JumpType) + { + case InsideStatementJumpType.Break: + g.SetJump(endBlockLabel); + break; + case InsideStatementJumpType.Continue: + g.SetJump(startBlockLabel); + break; + } + }); + result.Add(new Goto(startBlockLabel)); + + result.Add(new EndBlock(BlockType.Loop, blockId), endBlockLabel.Name); + + return result; + } + + public AddressedInstructions Visit(IfStatement visitable) + { + if (visitable.Empty()) + return new(); + + var blockId = $"if_else_{visitable.GetHashCode()}"; + var startBlockLabel = new Label($"Start_{blockId}"); + var endBlockLabel = new Label($"End_{blockId}"); + + var result = new AddressedInstructions(); + + if (visitable.Test is PrimaryExpression primary) + result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); + else + { + result.AddRange(visitable.Test.Accept(_expressionVisitor)); + var last = new Name(result.OfType().Last().Left); + result.Add(new IfNotGoto(last, + visitable.HasElseBlock() + ? startBlockLabel + : endBlockLabel) + ); + } + + result.AddRange(visitable.Then.Accept(this)); + result.Add(new Goto(endBlockLabel)); + result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); + + if (visitable.HasElseBlock()) + result.AddRange(visitable.Else.Accept(this)); + + result.OfType().Where(g => g.JumpType is InsideStatementJumpType.Break) + .ToList().ForEach(g=> g.SetJump(endBlockLabel)); + + result.Add(new EndBlock(BlockType.Condition, blockId), endBlockLabel.Name); + + return result; + } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs similarity index 57% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs index bd176e61..59c91062 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class ArrayAccessException : SemanticException { public ArrayAccessException(Segment segment, Type type) : diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs new file mode 100644 index 00000000..48d187e9 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class AssignmentToConst : SemanticException +{ + public AssignmentToConst(IdentifierReference ident) : + base(ident.Segment,$"Cannot assign to const: {ident.Name}") { } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs new file mode 100644 index 00000000..df99c271 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class CannotDefineType : SemanticException +{ + public CannotDefineType(Segment segment) : + base(segment, "Cannot define type") { } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs new file mode 100644 index 00000000..2b0aa885 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class ConstWithoutInitializer : SemanticException +{ + public ConstWithoutInitializer(IdentifierReference ident) : + base(ident.Segment, $"'const' without initializer: {ident.Name}") { } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs new file mode 100644 index 00000000..ceafadc9 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class DeclarationAlreadyExists : SemanticException +{ + public DeclarationAlreadyExists(IdentifierReference ident) : + base(ident.Segment, $"Declaration already exists: {ident.Name}") { } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs similarity index 57% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs index 09098d33..26bdddf1 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class FunctionWithoutReturnStatement : SemanticException { public FunctionWithoutReturnStatement(Segment segment) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs similarity index 57% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs index d896c792..8781ac8b 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class IncompatibleTypesOfOperands : SemanticException { public IncompatibleTypesOfOperands(Segment segment, Type left, Type right) : diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs new file mode 100644 index 00000000..9b76fa14 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs @@ -0,0 +1,10 @@ +using System.Diagnostics.CodeAnalysis; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class NonAccessibleType : SemanticException +{ + public NonAccessibleType(Type type) : + base($"Type '{type}' is not array-like or object-like") { } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs similarity index 55% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs index a1940bb2..66bb9b3c 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class NotBooleanTestExpression : SemanticException { public NotBooleanTestExpression(Segment segment, Type type) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs similarity index 51% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs index ae459389..2fbc9028 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs @@ -1,8 +1,10 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.IR.CheckSemantics.Types; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.IR.CheckSemantics.Types; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class ObjectAccessException : SemanticException { public ObjectAccessException(Segment segment, ObjectType objectType, string field) : diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs new file mode 100644 index 00000000..799f8807 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class OutsideOfStatement : SemanticException +{ + public OutsideOfStatement(Segment segment, string keyword, string statement) : + base(segment, $"Jump \"{keyword}\" outside of statement \"{statement}\"") { } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs similarity index 50% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs index bd27215e..4fcb25b5 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class ReturnOutsideFunction : SemanticException { public ReturnOutsideFunction(Segment segment) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs similarity index 68% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs index 1571a424..e5c2d5e9 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs @@ -1,8 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; -[Serializable] +[Serializable, ExcludeFromCodeCoverage] public abstract class SemanticException : Exception { protected SemanticException() { } diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs new file mode 100644 index 00000000..9dd2e9cc --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class SymbolIsNotCallable : SemanticException +{ + public SymbolIsNotCallable(string symbol, Segment segment) : + base(segment, $"Symbol is not callable: {symbol}") { } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs new file mode 100644 index 00000000..523a01ce --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class UnknownIdentifierReference : SemanticException +{ + public UnknownIdentifierReference(IdentifierReference ident) : + base(ident.Segment, $"Unknown identifier reference: {ident.Name}") { } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs similarity index 56% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs index e6194f7f..e2fe77bc 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class UnsupportedOperation : SemanticException { public UnsupportedOperation(Segment segment, Type type, string @operator) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs similarity index 60% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs index 63b09d55..f14a072b 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class WrongArrayLiteralDeclaration : SemanticException { public WrongArrayLiteralDeclaration(Segment segment, Type type) : diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs new file mode 100644 index 00000000..5f04a672 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs @@ -0,0 +1,11 @@ +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; + +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; + +[ExcludeFromCodeCoverage] +public class WrongAssignmentTarget : SemanticException +{ + public WrongAssignmentTarget(LeftHandSideExpression lhs) : + base(lhs.Segment, $"Assignment target must be variable, property or indexer. '{lhs.Id.Name}' is {lhs.GetType().Name}") { } +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs similarity index 63% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs index eb2aaa3e..78e87b63 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class WrongConditionalTypes : SemanticException { public WrongConditionalTypes(Segment cSegment, Type cType, Segment aSegment, Type aType) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs similarity index 58% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs index 630cc175..0260cdc3 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class WrongNumberOfArguments : SemanticException { public WrongNumberOfArguments(Segment segment, int expected, int actual) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs similarity index 56% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs index 203ad081..6a9feefc 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class WrongReturnType : SemanticException { public WrongReturnType(Segment segment, Type expected, Type actual) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs similarity index 57% rename from Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs rename to HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs index 6b34e8c2..77ae4927 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs @@ -1,7 +1,9 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using System.Diagnostics.CodeAnalysis; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +[ExcludeFromCodeCoverage] public class WrongTypeOfArgument : SemanticException { public WrongTypeOfArgument(Segment segment, Type expected, Type actual) : diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/Any.cs b/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs similarity index 78% rename from Interpreter.Lib/IR/CheckSemantics/Types/Any.cs rename to HydraScript.Lib/IR/CheckSemantics/Types/Any.cs index ff982fbc..652758fe 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Types/Any.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Lib.IR.CheckSemantics.Types; public class Any : Type { diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs new file mode 100644 index 00000000..60168d34 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs @@ -0,0 +1,32 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Types; + +public class ArrayType : Type +{ + public Type Type { get; private set; } + + public ArrayType(Type type) : + base($"{type}[]") => + Type = type; + + public override void ResolveReference( + Type reference, + string refId, + ISet visited = null) + { + if (Type == refId) + Type = reference; + else + Type.ResolveReference(reference, refId, visited); + } + + public override bool Equals(object obj) + { + if (obj is ArrayType that) + return Equals(Type, that.Type); + return obj is Any; + } + + public override int GetHashCode() => + // ReSharper disable once NonReadonlyMemberInGetHashCode + Type.GetHashCode(); +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/NullType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs similarity index 50% rename from Interpreter.Lib/IR/CheckSemantics/Types/NullType.cs rename to HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs index 8d78a520..b3886910 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Types/NullType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Lib.IR.CheckSemantics.Types; public class NullType : Type { @@ -6,10 +6,8 @@ public NullType() : base("null") { } - public override bool Equals(object obj) - { - return obj is NullableType or NullType; - } + public override bool Equals(object obj) => + obj is NullableType or NullType or Any; public override int GetHashCode() => "null".GetHashCode(); diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs new file mode 100644 index 00000000..f88327c3 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs @@ -0,0 +1,37 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Types; + +public class NullableType : Type +{ + public Type Type { get; private set; } + + public NullableType(Type type) : + base($"{type}?") => + Type = type; + + protected NullableType() + { + } + + public override void ResolveReference( + Type reference, + string refId, + ISet visited = null) + { + if (Type == refId) + Type = reference; + else + Type.ResolveReference(reference, refId, visited); + } + + public override bool Equals(object obj) + { + if (obj is NullableType that) + return Equals(Type, that.Type); + + return obj is NullType or Any; + } + + public override int GetHashCode() => + // ReSharper disable once NonReadonlyMemberInGetHashCode + Type.GetHashCode(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs new file mode 100644 index 00000000..0726d241 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs @@ -0,0 +1,188 @@ +using System.Text; + +namespace HydraScript.Lib.IR.CheckSemantics.Types; + +public class ObjectType : NullableType +{ + private readonly Dictionary _properties; + private readonly HashSet _methods; + private readonly ObjectTypeHasher _hasher; + private readonly ObjectTypePrinter _serializer; + + public string LastAccessedMethod { get; private set; } + + public ObjectType(IEnumerable properties) + { + _properties = properties + .OrderBy(x => x.Id) + .ToDictionary( + x => x.Id, + x => x.Type); + _methods = new HashSet(); + + _hasher = new ObjectTypeHasher(this); + _serializer = new ObjectTypePrinter(this); + } + + public Type this[string id] + { + get => _properties.GetValueOrDefault(id); + private set => _properties[id] = value; + } + + public void AddMethod(string methodName) => + _methods.Add(methodName); + + public bool HasMethod(string methodName) + { + LastAccessedMethod = methodName; + return _methods.Contains(methodName); + } + + public override void ResolveReference( + Type reference, + string refId, + ISet visited = null) + { + visited ??= new HashSet(); + if (!visited.Add(this)) + return; + + foreach (var key in _properties.Keys) + if (refId == this[key]) + this[key] = reference; + else + this[key].ResolveReference(reference, refId, visited); + } + + public override bool Equals(object obj) + { + if (obj is ObjectType that) + return ReferenceEquals(this, that) || + _properties.Count == that._properties.Count && + _properties.Zip(that._properties) + .All(pair => + pair.First.Key == pair.Second.Key && + pair.First.Value.Equals(pair.Second.Value)); + + return obj is NullType or Any; + } + + public override int GetHashCode() => + _hasher.HashObjectType(this); + + public override string ToString() + { + var result = _serializer.PrintObjectType(this); + _serializer.Clear(); + return result; + } + + private class ObjectTypeHasher + { + private readonly ObjectType _reference; + + public ObjectTypeHasher(ObjectType reference) => + _reference = reference; + + private int Hash(Type type) => type switch + { + ArrayType arrayType => HashArrayType(arrayType), + ObjectType objectType => HashObjectType(objectType), + NullableType nullableType => HashNullableType(nullableType), + _ => type.GetHashCode() + }; + + public int HashObjectType(ObjectType objectType) => + objectType._properties.Keys.Select( + key => HashCode.Combine( + key, + objectType[key].Equals(_reference) + ? "@this".GetHashCode() + : objectType[key].GetType().GetHashCode())) + .Aggregate(36, HashCode.Combine); + + private int HashArrayType(ArrayType arrayType) => + arrayType.Type.Equals(_reference) + ? "@this".GetHashCode() + : Hash(arrayType.Type); + + private int HashNullableType(NullableType nullableType) => + nullableType.Type.Equals(_reference) + ? "@this".GetHashCode() + : Hash(nullableType.Type); + } + + private class ObjectTypePrinter + { + private readonly ObjectType _reference; + private readonly ISet _visited; + + public ObjectTypePrinter(ObjectType reference) + { + _reference = reference; + _visited = new HashSet(); + } + + public void Clear() => _visited.Clear(); + + private string Print(Type type) => type switch + { + ArrayType arrayType => PrintArrayType(arrayType), + ObjectType objectType => PrintObjectType(objectType), + NullableType nullableType => PrintNullableType(nullableType), + _ => type.ToString() + }; + + public string PrintObjectType(ObjectType objectType) + { + if (_visited.Contains(objectType)) + return string.Empty; + if (!objectType.Equals(_reference)) + _visited.Add(objectType); + + var sb = new StringBuilder("{"); + foreach (var key in objectType._properties.Keys) + { + var type = objectType[key]; + var prop = $"{key}: "; + + if (type.Equals(_reference)) + prop += "@this"; + else + { + var printedType = Print(type); + prop += string.IsNullOrEmpty(printedType) + ? key + : printedType; + } + + sb.Append(prop).Append(';'); + } + + return sb.Append('}').ToString(); + } + + private string PrintArrayType(ArrayType arrayType) + { + var sb = new StringBuilder(); + sb.Append(arrayType.Type.Equals(_reference) + ? "@this" + : Print(arrayType.Type)); + + return sb.Append("[]").ToString(); + } + + private string PrintNullableType(NullableType nullableType) + { + var sb = new StringBuilder(); + sb.Append(nullableType.Type.Equals(_reference) + ? "@this" + : Print(nullableType.Type)); + + return sb.Append('?').ToString(); + } + } +} + +public record PropertyType(string Id, Type Type); \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs b/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs new file mode 100644 index 00000000..66a30874 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs @@ -0,0 +1,42 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Types; + +public class Type +{ + private readonly string _name; + + protected Type() + { + } + + public Type(string name) => + _name = name; + + public virtual void ResolveReference( + Type reference, + string refId, + ISet visited = null) + { + } + + public override bool Equals(object obj) => + obj switch + { + Any => true, + Type that => _name == that._name, + _ => false + }; + + public override int GetHashCode() => + _name.GetHashCode(); + + public override string ToString() => _name; + + public static implicit operator Type(string alias) => + new(alias); + + public static bool operator ==(Type left, Type right) => + Equals(left, right); + + public static bool operator !=(Type left, Type right) => + !(left == right); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs new file mode 100644 index 00000000..b36c2e63 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs @@ -0,0 +1,41 @@ +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Variables; + +public class SymbolTable +{ + private readonly Dictionary _symbols = new(); + + private SymbolTable _openScope; + + public void AddOpenScope(SymbolTable table) + { + _openScope = table; + } + + /// + /// Символы доступные в области видимости таблицы + /// + public IEnumerable GetAvailableSymbols() => + _symbols.Values.Concat(_openScope?.GetAvailableSymbols() ?? Array.Empty()); + + public void AddSymbol(Symbol symbol) => + _symbols[symbol.Id] = symbol; + + /// + /// Поиск эффективного символа + /// + public TSymbol FindSymbol(string id) where TSymbol : Symbol + { + var hasInsideTheScope = _symbols.TryGetValue(id, out var symbol); + return !hasInsideTheScope + ? _openScope?.FindSymbol(id) + : symbol as TSymbol; + } + + /// + /// Проверяет наличие собственного символа + /// + public bool ContainsSymbol(string id) => + _symbols.ContainsKey(id); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs new file mode 100644 index 00000000..fc5bfb82 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs @@ -0,0 +1,35 @@ +using System.Text; + +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +public class FunctionSymbol : Symbol +{ + private Type _returnType; + + public override string Id { get; } + /// Тип возврата функции + public override Type Type => _returnType; + public IReadOnlyList Parameters { get; } + public bool IsEmpty { get; } + + public FunctionSymbol( + string id, + IEnumerable parameters, + Type returnType, + bool isEmpty) + { + Id = id; + Parameters = new List(parameters); + _returnType = returnType; + IsEmpty = isEmpty; + } + + public void DefineReturnType(Type returnType) => + _returnType = returnType; + + public override string ToString() => + new StringBuilder($"function {Id}(") + .AppendJoin(',', Parameters) + .Append($") => {Type}") + .ToString(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs new file mode 100644 index 00000000..db59ea0d --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs @@ -0,0 +1,14 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; + +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +public class ObjectSymbol : VariableSymbol +{ + public override ObjectType Type { get; } + + public ObjectSymbol(string id, ObjectType objectType, bool readOnly = false) : + base(id, objectType, readOnly) + { + Type = objectType; + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs new file mode 100644 index 00000000..bf392ca4 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs @@ -0,0 +1,7 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +public abstract class Symbol +{ + public abstract string Id { get; } + public abstract Type Type { get; } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs new file mode 100644 index 00000000..f36267d0 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs @@ -0,0 +1,30 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +public class TypeSymbol : Symbol +{ + public override string Id { get; } + public override Type Type { get; } + + public TypeSymbol(Type type, string id = null) + { + Id = id ?? type.ToString(); + Type = type; + } + + public override bool Equals(object obj) + { + if (obj is TypeSymbol typeSymbol) + { + return Id == typeSymbol.Id && + Type.Equals(typeSymbol.Type); + } + + return false; + } + + public override int GetHashCode() => + HashCode.Combine(Id, Type); + + public override string ToString() => + $"type {Id} = {Type}"; +} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs similarity index 56% rename from Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs rename to HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs index 9ef2db85..1bff17a3 100644 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs @@ -1,12 +1,17 @@ -namespace Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; public class VariableSymbol : Symbol { + public override string Id { get; } + public override Type Type { get; } public bool ReadOnly { get; } - public VariableSymbol(string id, Type type, bool readOnly = false) : - base(id, type) => + public VariableSymbol(string id, Type type, bool readOnly = false) + { + Id = id; + Type = type; ReadOnly = readOnly; + } public override string ToString() => $"{(ReadOnly ? "const " : "")}{Id}: {Type}"; } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs new file mode 100644 index 00000000..9a1c4f4f --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs @@ -0,0 +1,99 @@ +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors; + +public class DeclarationVisitor : + IVisitor, + IVisitor, + IVisitor +{ + private readonly IFunctionWithUndefinedReturnStorage _functionStorage; + private readonly IMethodStorage _methodStorage; + + public DeclarationVisitor( + IFunctionWithUndefinedReturnStorage functionStorage, + IMethodStorage methodStorage) + { + _functionStorage = functionStorage; + _methodStorage = methodStorage; + } + + public Unit Visit(AbstractSyntaxTreeNode visitable) + { + foreach (var child in visitable) + child.Accept(this); + + return default; + } + + public Unit Visit(LexicalDeclaration visitable) + { + foreach (var assignment in visitable.Assignments) + { + if (visitable.SymbolTable.ContainsSymbol(assignment.Destination.Id)) + throw new DeclarationAlreadyExists(assignment.Destination.Id); + + var destinationType = assignment.DestinationType?.BuildType( + assignment.SymbolTable) ?? "undefined"; + + if (destinationType == "undefined" && + assignment.Source is ImplicitLiteral or ArrayLiteral { Expressions.Count: 0 }) + throw visitable.ReadOnly + ? new ConstWithoutInitializer(assignment.Destination.Id) + : new CannotDefineType(assignment.Destination.Id.Segment); + + visitable.SymbolTable.AddSymbol( + new VariableSymbol( + assignment.Destination.Id, + destinationType)); + } + + return default; + } + + public Unit Visit(FunctionDeclaration visitable) + { + if (visitable.Parent.SymbolTable.ContainsSymbol(visitable.Name)) + throw new DeclarationAlreadyExists(visitable.Name); + + var parameters = visitable.Arguments.Select(x => + { + var arg = new VariableSymbol( + id: x.Key, + x.TypeValue.BuildType(visitable.Parent.SymbolTable)); + visitable.SymbolTable.AddSymbol(arg); + return arg; + }).ToList(); + + var functionSymbol = new FunctionSymbol( + visitable.Name, + parameters, + visitable.ReturnTypeValue.BuildType(visitable.Parent.SymbolTable), + isEmpty: !visitable.Statements.Any()); + if (parameters is [{ Type: ObjectType objectType }, ..] && + visitable.Arguments is [{ TypeValue: TypeIdentValue }, ..]) + { + _methodStorage.BindMethod(objectType, functionSymbol); + } + + Type undefined = "undefined"; + if (functionSymbol.Type.Equals(undefined)) + { + if (visitable.HasReturnStatement()) + _functionStorage.Save(functionSymbol, visitable); + else + functionSymbol.DefineReturnType("void"); + } + + visitable.Parent.SymbolTable.AddSymbol(functionSymbol); + return visitable.Statements.Accept(this); + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs new file mode 100644 index 00000000..36346fdb --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs @@ -0,0 +1,459 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors; + +public class SemanticChecker : + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor, + IVisitor +{ + private readonly IDefaultValueForTypeCalculator _calculator; + private readonly IFunctionWithUndefinedReturnStorage _functionStorage; + private readonly IMethodStorage _methodStorage; + + public SemanticChecker( + IDefaultValueForTypeCalculator calculator, + IFunctionWithUndefinedReturnStorage functionStorage, + IMethodStorage methodStorage) + { + _calculator = calculator; + _functionStorage = functionStorage; + _methodStorage = methodStorage; + } + + public Type Visit(ScriptBody visitable) + { + foreach (var statementListItem in visitable.StatementList) + statementListItem.Accept(this); + + foreach (var funcDecl in _functionStorage.Flush()) + funcDecl.Accept(this); + + return "undefined"; + } + + public Type Visit(WhileStatement visitable) + { + var condType = visitable.Condition.Accept(this); + Type boolean = "boolean"; + if (!condType.Equals(boolean)) + throw new NotBooleanTestExpression(visitable.Segment, condType); + + visitable.Statement.Accept(this); + + return "undefined"; + } + + public Type Visit(IfStatement visitable) + { + var testType = visitable.Test.Accept(this); + Type boolean = "boolean"; + if (!testType.Equals(boolean)) + throw new NotBooleanTestExpression(visitable.Segment, testType); + + visitable.Then.Accept(this); + visitable.Else?.Accept(this); + + return "undefined"; + } + + public Type Visit(InsideStatementJump visitable) + { + switch (visitable.Keyword) + { + case InsideStatementJump.Break: + if (!(visitable.ChildOf() || visitable.ChildOf())) + throw new OutsideOfStatement( + visitable.Segment, + keyword: InsideStatementJump.Break, + statement: "if|while"); + break; + case InsideStatementJump.Continue: + if (!visitable.ChildOf()) + throw new OutsideOfStatement( + visitable.Segment, + keyword: InsideStatementJump.Continue, + statement: "while"); + break; + } + + return "undefined"; + } + + public Type Visit(ReturnStatement visitable) + { + if (!visitable.ChildOf()) + throw new ReturnOutsideFunction(visitable.Segment); + + return visitable.Expression?.Accept(this) ?? "void"; + } + + public Type Visit(ExpressionStatement visitable) => + visitable.Expression.Accept(this); + + public Type Visit(IdentifierReference visitable) + { + var symbol = visitable.SymbolTable.FindSymbol(visitable.Name); + return symbol?.Type ?? throw new UnknownIdentifierReference(visitable); + } + + public Type Visit(ImplicitLiteral visitable) + { + var type = visitable.TypeValue.BuildType(visitable.Parent.SymbolTable); + visitable.ComputedDefaultValue = _calculator.GetDefaultValueForType(type); + return type; + } + + public Type Visit(ArrayLiteral visitable) + { + if (visitable.Expressions.Count == 0) + return new ArrayType(new Any()); + + var type = visitable.First().Accept(this); + if (visitable.Expressions.All(e => e.Accept(this).Equals(type))) + return new ArrayType(type); + + throw new WrongArrayLiteralDeclaration(visitable.Segment, type); + } + + public Type Visit(ObjectLiteral visitable) + { + var properties = visitable.Properties.Select(prop => + { + var propType = prop.Expression.Accept(this); + visitable.SymbolTable.AddSymbol(propType switch + { + ObjectType objectType => new ObjectSymbol(prop.Id, objectType), + _ => new VariableSymbol(prop.Id, propType) + }); + return new PropertyType(prop.Id, propType); + }); + var objectLiteralType = new ObjectType(properties); + return objectLiteralType; + } + + public Type Visit(ConditionalExpression visitable) + { + var tType = visitable.Test.Accept(this); + Type boolean = "boolean"; + if (!tType.Equals(boolean)) + throw new NotBooleanTestExpression(visitable.Test.Segment, tType); + + var cType = visitable.Consequent.Accept(this); + var aType = visitable.Alternate.Accept(this); + if (cType.Equals(aType)) + return cType; + + throw new WrongConditionalTypes( + cSegment: visitable.Consequent.Segment, + cType, + aSegment: visitable.Alternate.Segment, + aType); + } + + public Type Visit(BinaryExpression visitable) + { + var lType = visitable.Left.Accept(this); + var rType = visitable.Right.Accept(this); + + if (visitable.Operator != "::" && !lType.Equals(rType)) + throw new IncompatibleTypesOfOperands( + visitable.Segment, + left: lType, + right: rType); + + Type number = "number"; + Type @string = "string"; + Type boolean = "boolean"; + + return visitable.Operator switch + { + "+" when lType.Equals(number) => number, + "+" when lType.Equals(@string) => @string, + "+" => throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "-" or "*" or "/" or "%" => lType.Equals(number) + ? number + : throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "||" or "&&" => lType.Equals(boolean) + ? boolean + : throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "==" or "!=" => boolean, + ">" or ">=" or "<" or "<=" => lType.Equals(number) + ? boolean + : throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "++" when lType is ArrayType { Type: Any } && rType is ArrayType { Type: Any } => + throw new CannotDefineType(visitable.Segment), + "++" => lType is ArrayType lArrType && rType is ArrayType rArrType + ? new List { lArrType, rArrType }.First(x => x.Type is not Any) + : throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "::" when lType is not ArrayType => + throw new UnsupportedOperation(visitable.Segment, lType, visitable.Operator), + "::" => rType.Equals(number) ? "void" : throw new ArrayAccessException(visitable.Segment, rType), + _ => "undefined" + }; + } + + public Type Visit(UnaryExpression visitable) + { + var eType = visitable.Expression.Accept(this); + + Type number = "number"; + Type boolean = "boolean"; + + return visitable.Operator switch + { + "-" when eType.Equals(number) => number, + "!" when eType.Equals(boolean) => boolean, + "~" when eType is ArrayType => number, + _ => throw new UnsupportedOperation(visitable.Segment, eType, visitable.Operator) + }; + } + + public Type Visit(LexicalDeclaration visitable) + { + Type undefined = "undefined"; + + foreach (var assignment in visitable.Assignments) + { + var registeredSymbol = visitable.SymbolTable.FindSymbol( + assignment.Destination.Id); + var sourceType = assignment.Source.Accept(this); + if (sourceType.Equals(undefined)) + throw new CannotDefineType(assignment.Source.Segment); + if (!registeredSymbol.Type.Equals(undefined) && !registeredSymbol.Type.Equals(sourceType)) + throw new IncompatibleTypesOfOperands( + assignment.Segment, + left: registeredSymbol.Type, + right: sourceType); + + var actualType = registeredSymbol.Type.Equals(undefined) + ? sourceType + : registeredSymbol.Type; + var actualSymbol = actualType switch + { + ObjectType objectType => new ObjectSymbol(registeredSymbol.Id, objectType, visitable.ReadOnly), + _ => new VariableSymbol(registeredSymbol.Id, actualType, visitable.ReadOnly) + }; + visitable.SymbolTable.AddSymbol(actualSymbol); + } + + return undefined; + } + + public Type Visit(AssignmentExpression visitable) + { + if (visitable.Destination is CallExpression) + throw new WrongAssignmentTarget(visitable.Destination); + + var sourceType = visitable.Source.Accept(this); + if (!visitable.Destination.Empty()) + { + var destinationType = visitable.Destination.Accept(this); + if (!destinationType.Equals(sourceType)) + throw new IncompatibleTypesOfOperands( + visitable.Segment, + left: destinationType, + right: sourceType); + return destinationType; + } + + var symbol = + visitable.SymbolTable.FindSymbol( + visitable.Destination.Id) ?? + throw new UnknownIdentifierReference(visitable.Destination.Id); + + if (symbol.ReadOnly) + throw new AssignmentToConst(visitable.Destination.Id); + + if (!sourceType.Equals(symbol.Type)) + throw new IncompatibleTypesOfOperands( + visitable.Segment, + left: symbol.Type, + right: sourceType); + + return symbol.Type; + } + + public Type Visit(MemberExpression visitable) + { + var idType = visitable.Id.Accept(this); + visitable.ComputedIdType = idType; + return visitable.Empty() ? idType : visitable.AccessChain?.Accept(this); + } + + public Type Visit(IndexAccess visitable) + { + var prevType = + visitable.Prev?.ComputedType + ?? (visitable.Parent as MemberExpression)!.ComputedIdType; + + if (prevType is not ArrayType arrayType) + throw new NonAccessibleType(prevType); + + Type number = "number"; + var indexType = visitable.Index.Accept(this); + if (!indexType.Equals(number)) + throw new ArrayAccessException(visitable.Segment, indexType); + + var elemType = arrayType.Type; + visitable.ComputedType = elemType; + return visitable.HasNext() ? visitable.Next.Accept(this) : elemType; + } + + public Type Visit(DotAccess visitable) + { + var prevType = + visitable.Prev?.ComputedType + ?? (visitable.Parent as MemberExpression)!.ComputedIdType; + + if (prevType is not ObjectType objectType) + throw new NonAccessibleType(prevType); + + var fieldType = objectType[visitable.Property]; + var hasMethod = objectType.HasMethod(visitable.Property); + if (fieldType is null) + return hasMethod + ? objectType + : throw new ObjectAccessException(visitable.Segment, objectType, visitable.Property); + visitable.ComputedType = fieldType; + return visitable.HasNext() ? visitable.Next.Accept(this) : fieldType; + } + + public Type Visit(CastAsExpression visitable) + { + Type undefined = "undefined"; + var exprType = visitable.Expression.Accept(this); + + if (exprType.Equals(undefined)) + throw new CannotDefineType(visitable.Expression.Segment); + + return visitable.Cast.BuildType(visitable.SymbolTable) == "string" + ? "string" + : throw new NotSupportedException("Other types but 'string' have not been supported for casting yet"); + } + + public Type Visit(CallExpression visitable) + { + FunctionSymbol functionSymbol; + var methodCall = !visitable.Member.Empty(); + + if (methodCall) + { + var objectType = (ObjectType)visitable.Member.Accept(this); + var availableMethods = _methodStorage.GetAvailableMethods(objectType); + functionSymbol = availableMethods[objectType.LastAccessedMethod]; + } + else + { + var symbol = + visitable.SymbolTable.FindSymbol(visitable.Id) + ?? throw new UnknownIdentifierReference(visitable.Id); + functionSymbol = + symbol as FunctionSymbol + ?? throw new SymbolIsNotCallable(symbol.Id, visitable.Id.Segment); + } + + var functionReturnType = functionSymbol.Type; + + if (functionSymbol.Parameters.Count != visitable.Parameters.Count + (methodCall ? 1 : 0)) + throw new WrongNumberOfArguments( + visitable.Segment, + expected: functionSymbol.Parameters.Count, + actual: visitable.Parameters.Count); + + visitable.Parameters.Zip(functionSymbol.Parameters.ToArray()[(methodCall ? 1 : 0)..]) + .ToList().ForEach(pair => + { + var (expr, expected) = pair; + var actualType = expr.Accept(this); + if (!actualType.Equals(expected.Type)) + throw new WrongTypeOfArgument(expr.Segment, expected.Type, actualType); + }); + + Type undefined = "undefined"; + if (functionSymbol.Type.Equals(undefined)) + { + var declaration = _functionStorage.Get(functionSymbol); + functionReturnType = declaration.Accept(this); + } + + return functionReturnType; + } + + public Type Visit(FunctionDeclaration visitable) + { + var symbol = visitable.SymbolTable.FindSymbol(visitable.Name); + _functionStorage.RemoveIfPresent(symbol); + visitable.Statements.Accept(this); + + var returnStatements = visitable.GetReturnStatements() + .Select(x => new + { + Statement = x, + Type = x.Accept(this) + }); + Type undefined = "undefined"; + if (symbol.Type.Equals(undefined)) + { + var returnStatementTypes = returnStatements + .GroupBy(x => x.Type) + .Select(x => x.Key) + .ToList(); + if (returnStatementTypes.Count > 1) + throw new CannotDefineType(visitable.Segment); + symbol.DefineReturnType(returnStatementTypes.ElementAtOrDefault(0) ?? "void"); + } + else + { + var wrongReturn = returnStatements + .FirstOrDefault(x => !x.Type.Equals(symbol.Type)); + if (wrongReturn is not null) + throw new WrongReturnType( + wrongReturn.Statement.Segment, + expected: symbol.Type, + actual: wrongReturn.Type); + } + + Type @void = "void"; + var hasReturnStatement = visitable.HasReturnStatement(); + if (!symbol.Type.Equals(@void) && !hasReturnStatement) + throw new FunctionWithoutReturnStatement(visitable.Segment); + + return symbol.Type; + } + + public Type Visit(BlockStatement visitable) + { + visitable.StatementList.ForEach(x => x.Accept(this)); + return "undefined"; + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs new file mode 100644 index 00000000..a833943c --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface IDefaultValueForTypeCalculator +{ + public object GetDefaultValueForType(Type type); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs new file mode 100644 index 00000000..9f75a9c5 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs @@ -0,0 +1,15 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface IFunctionWithUndefinedReturnStorage +{ + void Save(FunctionSymbol symbol, FunctionDeclaration declaration); + + FunctionDeclaration Get(FunctionSymbol symbol); + + void RemoveIfPresent(FunctionSymbol symbol); + + IEnumerable Flush(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs new file mode 100644 index 00000000..5312c5f2 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface IJavaScriptTypesProvider +{ + IEnumerable GetDefaultTypes(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs new file mode 100644 index 00000000..d9dfff56 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs @@ -0,0 +1,11 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface IMethodStorage +{ + void BindMethod(ObjectType objectType, FunctionSymbol method); + + IReadOnlyDictionary GetAvailableMethods(ObjectType objectType); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs new file mode 100644 index 00000000..4da013d6 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.IR.CheckSemantics.Variables; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface IStandardLibraryProvider +{ + SymbolTable GetStandardLibrary(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs new file mode 100644 index 00000000..cc06be62 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs @@ -0,0 +1,10 @@ +using HydraScript.Lib.IR.Ast; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface ISymbolTableInitializerService +{ + void InitThroughParent(AbstractSyntaxTreeNode node); + + void InitWithNewScope(AbstractSyntaxTreeNode node); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs new file mode 100644 index 00000000..8576b169 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs @@ -0,0 +1,10 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface ITypeDeclarationsResolver +{ + void Store(TypeDeclaration declaration); + + void Resolve(); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs new file mode 100644 index 00000000..90c8baee --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs @@ -0,0 +1,30 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator +{ + private readonly Type _boolean = "boolean"; + private readonly Type _number = "number"; + private readonly Type _string = "string"; + private readonly Type _void = "void"; + private readonly Type _null = new NullType(); + + public object GetDefaultValueForType(Type type) + { + if (type.Equals(_boolean)) + return false; + if (type.Equals(_number)) + return 0; + if (type.Equals(_string)) + return string.Empty; + if (type.Equals(_void)) + return new object(); + if (type.Equals(_null)) + return null; + if (type is ArrayType) + return new List(); + + return new object(); + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs new file mode 100644 index 00000000..3f4bab11 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs @@ -0,0 +1,40 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage +{ + private readonly Dictionary _declarations = new(); + private readonly Dictionary _keysWithOrder = new(); + + public void Save(FunctionSymbol symbol, FunctionDeclaration declaration) + { + _declarations[symbol.Id] = declaration; + _keysWithOrder[symbol.Id] = _declarations.Count; + } + + public FunctionDeclaration Get(FunctionSymbol symbol) + { + if (!_declarations.Remove(symbol.Id, out var declaration)) + throw new InvalidOperationException(message: "Cannot get function that has not been saved"); + + _keysWithOrder.Remove(symbol.Id); + return declaration; + } + + public void RemoveIfPresent(FunctionSymbol symbol) + { + _declarations.Remove(symbol.Id); + _keysWithOrder.Remove(symbol.Id); + } + + public IEnumerable Flush() => _declarations + .OrderBy(kvp => _keysWithOrder[kvp.Key]) + .Select(x => + { + _declarations.Remove(x.Key); + _keysWithOrder.Remove(x.Key); + return x.Value; + }); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs new file mode 100644 index 00000000..2af4f36f --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs @@ -0,0 +1,16 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class JavaScriptTypesProvider : IJavaScriptTypesProvider +{ + public IEnumerable GetDefaultTypes() + { + yield return "number"; + yield return "boolean"; + yield return "string"; + yield return new NullType(); + yield return "undefined"; + yield return "void"; + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs new file mode 100644 index 00000000..bb98d574 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs @@ -0,0 +1,20 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class MethodStorage : IMethodStorage +{ + private readonly Dictionary> _bindings = new(); + + public void BindMethod(ObjectType objectType, FunctionSymbol method) + { + objectType.AddMethod(method.Id); + if (!_bindings.ContainsKey(objectType)) + _bindings[objectType] = new Dictionary(); + _bindings[objectType][method.Id] = method; + } + + public IReadOnlyDictionary GetAvailableMethods(ObjectType objectType) => + _bindings.GetValueOrDefault(objectType, new Dictionary()); +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs new file mode 100644 index 00000000..35d9494f --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs @@ -0,0 +1,38 @@ +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class StandardLibraryProvider : IStandardLibraryProvider +{ + private readonly IJavaScriptTypesProvider _provider; + + public StandardLibraryProvider(IJavaScriptTypesProvider provider) => + _provider = provider; + + public SymbolTable GetStandardLibrary() + { + var library = new SymbolTable(); + + foreach (var type in _provider.GetDefaultTypes()) + { + library.AddSymbol(new TypeSymbol(type)); + } + + var print = new FunctionSymbol( + "print", + new List + { + new VariableSymbol("str", "string") + }, + "void", + isEmpty: false + ); + + library.AddSymbol(print); + + var symbolTable = new SymbolTable(); + symbolTable.AddOpenScope(library); + return symbolTable; + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs new file mode 100644 index 00000000..8564f59a --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs @@ -0,0 +1,15 @@ +using HydraScript.Lib.IR.Ast; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class SymbolTableInitializerService : ISymbolTableInitializerService +{ + public void InitThroughParent(AbstractSyntaxTreeNode node) => + node.SymbolTable = node.Parent.SymbolTable; + + public void InitWithNewScope(AbstractSyntaxTreeNode node) + { + node.SymbolTable = new(); + node.SymbolTable.AddOpenScope(node.Parent.SymbolTable); + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs new file mode 100644 index 00000000..0d8134b8 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs @@ -0,0 +1,51 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +internal class TypeDeclarationsResolver : ITypeDeclarationsResolver +{ + private readonly Queue _declarationsToResolve = new(); + private readonly IJavaScriptTypesProvider _provider; + + public TypeDeclarationsResolver(IJavaScriptTypesProvider provider) => + _provider = provider; + + public void Store(TypeDeclaration declaration) => + _declarationsToResolve.Enqueue(declaration); + + public void Resolve() + { + var defaults = _provider.GetDefaultTypes() + .Select(x => new TypeSymbol(x)) + .ToList(); + + foreach (var declarationToResolve in _declarationsToResolve) + { + declarationToResolve.SymbolTable.AddSymbol( + new TypeSymbol( + declarationToResolve.BuildType(), + declarationToResolve.TypeId)); + } + + while (_declarationsToResolve.Any()) + { + var declarationToResolve = _declarationsToResolve.Dequeue(); + + var typeSymbol = declarationToResolve.SymbolTable + .FindSymbol(declarationToResolve.TypeId); + + var resolvingCandidates = declarationToResolve.SymbolTable + .GetAvailableSymbols() + .OfType() + .Except(defaults); + + foreach (var referenceSymbol in resolvingCandidates) + { + typeSymbol.Type.ResolveReference( + referenceSymbol.Type, + referenceSymbol.Id); + } + } + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs new file mode 100644 index 00000000..94bf278a --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs @@ -0,0 +1,54 @@ +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors; + +public class SymbolTableInitializer : + IVisitor, + IVisitor, + IVisitor, + IVisitor +{ + private readonly ISymbolTableInitializerService _initializerService; + private readonly IStandardLibraryProvider _provider; + + public SymbolTableInitializer( + ISymbolTableInitializerService initializerService, + IStandardLibraryProvider provider) + { + _initializerService = initializerService; + _provider = provider; + } + + public Unit Visit(AbstractSyntaxTreeNode visitable) + { + _initializerService.InitThroughParent(visitable); + foreach (var child in visitable) + child.Accept(this); + return default; + } + + public Unit Visit(ScriptBody visitable) + { + visitable.SymbolTable = _provider.GetStandardLibrary(); + visitable.StatementList.ForEach(item => item.Accept(this)); + return default; + } + + public Unit Visit(FunctionDeclaration visitable) + { + _initializerService.InitWithNewScope(visitable); + visitable.Statements.Accept(this); + return default; + } + + public Unit Visit(BlockStatement visitable) + { + _initializerService.InitWithNewScope(visitable); + visitable.StatementList.ForEach(item => item.Accept(this)); + return default; + } +} \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs new file mode 100644 index 00000000..871eb898 --- /dev/null +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs @@ -0,0 +1,55 @@ +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors; + +public class TypeSystemLoader : + IVisitor, + IVisitor, + IVisitor +{ + private readonly ITypeDeclarationsResolver _resolver; + private readonly ISet _defaultTypes; + + public TypeSystemLoader( + ITypeDeclarationsResolver resolver, + IJavaScriptTypesProvider provider) + { + _resolver = resolver; + _defaultTypes = provider.GetDefaultTypes().ToHashSet(); + } + + public Unit Visit(ScriptBody visitable) + { + visitable.StatementList.ForEach(item => item.Accept(this)); + _resolver.Resolve(); + return default; + } + + public Unit Visit(AbstractSyntaxTreeNode visitable) + { + foreach (var child in visitable) + child.Accept(this); + + return default; + } + + public Unit Visit(TypeDeclaration visitable) + { + if (visitable.SymbolTable.ContainsSymbol(visitable.TypeId) || + _defaultTypes.Contains(visitable.TypeId.Name)) + throw new DeclarationAlreadyExists(visitable.TypeId); + + visitable.SymbolTable.AddSymbol( + new TypeSymbol( + visitable.TypeId.Name, + visitable.TypeId)); + + _resolver.Store(visitable); + return default; + } +} \ No newline at end of file diff --git a/HydraScript.Tests/GlobalUsings.cs b/HydraScript.Tests/GlobalUsings.cs new file mode 100644 index 00000000..62a254b9 --- /dev/null +++ b/HydraScript.Tests/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; \ No newline at end of file diff --git a/HydraScript.Tests/Helpers/ListExtensions.cs b/HydraScript.Tests/Helpers/ListExtensions.cs new file mode 100644 index 00000000..76d0f164 --- /dev/null +++ b/HydraScript.Tests/Helpers/ListExtensions.cs @@ -0,0 +1,14 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Instructions; + +namespace HydraScript.Tests.Helpers; + +public static class ListExtensions +{ + public static AddressedInstructions ToAddressedInstructions(this List instructions) + { + var result = new AddressedInstructions(); + instructions.ForEach(x => result.Add(x)); + return result; + } +} \ No newline at end of file diff --git a/HydraScript.Tests/Helpers/MockExtensions.cs b/HydraScript.Tests/Helpers/MockExtensions.cs new file mode 100644 index 00000000..31c53040 --- /dev/null +++ b/HydraScript.Tests/Helpers/MockExtensions.cs @@ -0,0 +1,38 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using Microsoft.Extensions.Options; +using Moq; + +namespace HydraScript.Tests.Helpers; + +public static class MockExtensions +{ + public static Mock Trackable(this Mock halt) + { + halt.Setup(x => x.Execute(It.IsAny())) + .Returns(new HashAddress(seed: 0)).Verifiable(); + halt.Setup(x => x.End()).Returns(true); + return halt; + } + + public static IOptions ToOptions + (this Mock commandLineSettings) => + Options.Create(commandLineSettings.Object); + + public static Mock ToInstructionMock(this int number) + { + var result = new Mock(MockBehavior.Default) + { + CallBase = true + }; + + result.Setup(x => x.GetHashCode()) + .Returns(number); + + result.Setup(x => x.ToString()) + .Returns(number.ToString()); + + return result; + } +} \ No newline at end of file diff --git a/Interpreter.Tests/Interpreter.Tests.csproj b/HydraScript.Tests/HydraScript.Tests.csproj similarity index 87% rename from Interpreter.Tests/Interpreter.Tests.csproj rename to HydraScript.Tests/HydraScript.Tests.csproj index 4a4d264c..31970460 100644 --- a/Interpreter.Tests/Interpreter.Tests.csproj +++ b/HydraScript.Tests/HydraScript.Tests.csproj @@ -12,8 +12,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -30,8 +30,8 @@ - - + + diff --git a/Interpreter.Tests/Properties/AssemblyInfo.cs b/HydraScript.Tests/Properties/AssemblyInfo.cs similarity index 100% rename from Interpreter.Tests/Properties/AssemblyInfo.cs rename to HydraScript.Tests/Properties/AssemblyInfo.cs diff --git a/HydraScript.Tests/Stubs/SemanticExceptionStub.cs b/HydraScript.Tests/Stubs/SemanticExceptionStub.cs new file mode 100644 index 00000000..aa55647a --- /dev/null +++ b/HydraScript.Tests/Stubs/SemanticExceptionStub.cs @@ -0,0 +1,5 @@ +using HydraScript.Lib.IR.CheckSemantics.Exceptions; + +namespace HydraScript.Tests.Stubs; + +public class SemanticExceptionStub : SemanticException { } \ No newline at end of file diff --git a/HydraScript.Tests/TestData/InstructionsData.cs b/HydraScript.Tests/TestData/InstructionsData.cs new file mode 100644 index 00000000..506c1276 --- /dev/null +++ b/HydraScript.Tests/TestData/InstructionsData.cs @@ -0,0 +1,127 @@ +using System.Collections; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Values; + +namespace HydraScript.Tests.TestData; + +public class InstructionsData : IEnumerable +{ + public IEnumerator GetEnumerator() + { + yield return new object[] + { + new AsString(new Name("num")) + { + Left = "str" + }, + "str = num as string" + }; + yield return new object[] + { + new BeginBlock(BlockType.Function, blockId: "func") + { + Address = new Label("Start_func") + }, + "Start_func:\n\tBeginFunction func" + }; + yield return new object[] + { + new CallFunction(new FunctionInfo("func"), 2, false), + "Call func, 2" + }; + yield return new object[] + { + new CallFunction(new FunctionInfo("func"), 2, true) + { + Left = "ret" + }, + "ret = Call func, 2" + }; + yield return new object[] + { + new CreateArray("arr", 5), + "array arr = [5]" + }; + yield return new object[] + { + new CreateObject("obj"), + "object obj = {}" + }; + yield return new object[] + { + new DotAssignment("obj", new Constant("prop"), new Constant(3)), + "obj.prop = 3" + }; + yield return new object[] + { + new EndBlock(BlockType.Function, blockId: "func") + { + Address = new Label("End_func") + }, + "End_func:\n\tEndFunction func" + }; + yield return new object[] + { + new Goto(new Label("10")), + "Goto 10" + }; + yield return new object[] + { + new Halt(), + "End" + }; + yield return new object[] + { + new IfNotGoto(new Name("test"), new Label("17")), + "IfNot test Goto 17" + }; + yield return new object[] + { + new IndexAssignment("arr", new Constant(1), new Constant(1)), + "arr[1] = 1" + }; + yield return new object[] + { + new Print(new Name("str")), + "Print str" + }; + yield return new object[] + { + new PushParameter("param", new Name("value")), + "PushParameter param = value" + }; + yield return new object[] + { + new RemoveFromArray("arr", new Constant(0)), + "RemoveFrom arr at 0" + }; + yield return new object[] + { + new Return(), + "Return" + }; + yield return new object[] + { + new Return(new Name("result")), + "Return result" + }; + yield return new object[] + { + new Simple("a", (new Name("b"), new Name("c")), "+"), + "a = b + c" + }; + yield return new object[] + { + new Simple("b", (null, new Name("c")), "-"), + "b = -c" + }; + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); +} \ No newline at end of file diff --git a/Interpreter.Tests/TestData/LexerData.cs b/HydraScript.Tests/TestData/LexerData.cs similarity index 95% rename from Interpreter.Tests/TestData/LexerData.cs rename to HydraScript.Tests/TestData/LexerData.cs index a6addcfb..7d60d269 100644 --- a/Interpreter.Tests/TestData/LexerData.cs +++ b/HydraScript.Tests/TestData/LexerData.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace Interpreter.Tests.TestData; +namespace HydraScript.Tests.TestData; public class LexerSuccessData : IEnumerable { diff --git a/Interpreter.Tests/TestData/ParserData.cs b/HydraScript.Tests/TestData/ParserData.cs similarity index 52% rename from Interpreter.Tests/TestData/ParserData.cs rename to HydraScript.Tests/TestData/ParserData.cs index 8a9cda65..317c7e12 100644 --- a/Interpreter.Tests/TestData/ParserData.cs +++ b/HydraScript.Tests/TestData/ParserData.cs @@ -1,17 +1,24 @@ using System.Collections; -namespace Interpreter.Tests.TestData; +namespace HydraScript.Tests.TestData; public class ParserSuccessTestData : IEnumerable { public IEnumerator GetEnumerator() { + yield return new object[] { "-21" }; + yield return new object[] { "!false" }; + yield return new object[] { "~[]" }; + yield return new object[] { "x = ([1,2] ++ [3,4])::0" }; yield return new object[] {"i[0].j"}; yield return new object[] {"i[0].j()"}; yield return new object[] {"i = 1"}; yield return new object[] {"i[0] = 1"}; yield return new object[] {"i[a.b][1].x(1)"}; yield return new object[] {"(1 + 2) * (3 - (2 / 2)) as string"}; + yield return new object[] { "return {x:1;y:2;}" }; + yield return new object[] { "while (~arr != 0) { arr::0 continue }" }; + yield return new object[] { "if (!(true || (false && false))) { break } else { break }" }; } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); diff --git a/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs b/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs new file mode 100644 index 00000000..dd1e719f --- /dev/null +++ b/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs @@ -0,0 +1,95 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Tests.Helpers; +using Xunit; + +namespace HydraScript.Tests.Unit.BackEnd; + +public class AddressedInstructionsTests +{ + [Fact] + public void EnumerationPreservedAfterRemovalTest() + { + var instructions = new List + { + new AsString(new Constant(2)) + { + Left = "s" + }, + new Print(new Name("s")), + new Halt() + }.ToAddressedInstructions(); + + instructions.Remove(instructions[instructions.Start.Next]); + + Assert.Same(instructions.Last(), instructions[instructions.Start.Next]); + } + + [Fact] + public void RemovalOfLastDoesNotThrowTest() + { + var instructions = new List + { + new AsString(new Constant(2)), + new Halt() + }.ToAddressedInstructions(); + + Assert.Null(Record.Exception(() => instructions.Remove(instructions.Last()))); + Assert.Null(instructions.Start.Next); + } + + [Fact] + public void ReplacementPreservesOrderTest() + { + var instructions = new AddressedInstructions + { + new Simple("a", (new Constant(1), new Constant(2)), "-"), + { + new AsString(new Constant(true)) + { Left = "s" }, + "as_str" + }, + new Print(new Name("s")) + }; + + var old = instructions[new Label("as_str")]; + var @new = new AsString(new Name("a")) { Left = "s" }; + instructions.Replace(old, @new); + + var prev = instructions.First(); + var next = instructions.Last(); + + Assert.Same(@new, instructions[prev.Address.Next]); + Assert.Same(next, instructions[@new.Address.Next]); + } + + [Fact] + public void GetEnumeratorTests() + { + AddressedInstructions collection = new(); + collection.Add(1.ToInstructionMock().Object); + + var collectionToAdd = new AddressedInstructions + { + 2.ToInstructionMock().Object, + 3.ToInstructionMock().Object, + 4.ToInstructionMock().Object + }; + + collection.AddRange(collectionToAdd); + + collection.Add(5.ToInstructionMock().Object); + + Assert.Collection( + collection.Select(x => x.ToString()), + x => Assert.Equal("1", x), + x => Assert.Equal("2", x), + x => Assert.Equal("3", x), + x => Assert.Equal("4", x), + x => Assert.Equal("5", x) + ); + } +} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/BackEnd/CallTests.cs b/HydraScript.Tests/Unit/BackEnd/CallTests.cs similarity index 50% rename from Interpreter.Tests/Unit/BackEnd/CallTests.cs rename to HydraScript.Tests/Unit/BackEnd/CallTests.cs index 48571a99..e774efcd 100644 --- a/Interpreter.Tests/Unit/BackEnd/CallTests.cs +++ b/HydraScript.Tests/Unit/BackEnd/CallTests.cs @@ -1,20 +1,21 @@ -using Interpreter.Lib.BackEnd; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; using Xunit; -namespace Interpreter.Tests.Unit.BackEnd; +namespace HydraScript.Tests.Unit.BackEnd; public class CallTests { [Fact] public void ToStringCorrect() { - var call = new Call(9, new FunctionInfo("func"), + var call = new Call(new Label("9"), new FunctionInfo("func"), new List<(string Id, object Value)> { ("arg", 1) } ); - const string expected = "9 => 0: func(arg: 1)"; + const string expected = "9:\n\t => Start_func:\n\t: func(arg: 1)"; Assert.Equal(expected, call.ToString()); } } \ No newline at end of file diff --git a/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs b/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs new file mode 100644 index 00000000..9caed316 --- /dev/null +++ b/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs @@ -0,0 +1,23 @@ +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Tests.TestData; +using Xunit; + +namespace HydraScript.Tests.Unit.BackEnd; + +public class InstructionsTests +{ + [Theory] + [ClassData(typeof(InstructionsData))] + public void ToStringCorrectTest(Instruction instruction, string expected) => + Assert.Equal(expected, instruction.ToString()); + + [Fact] + public void GotoJumpChangedTest() + { + var @goto = new Goto(new Label("1")); + @goto.SetJump(new Label("5")); + Assert.Equal(new Label("5"), @goto.Execute(vm: null)); + } +} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/BackEnd/ValuesTests.cs b/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs similarity index 83% rename from Interpreter.Tests/Unit/BackEnd/ValuesTests.cs rename to HydraScript.Tests/Unit/BackEnd/ValuesTests.cs index 20dc7dc6..866fc92b 100644 --- a/Interpreter.Tests/Unit/BackEnd/ValuesTests.cs +++ b/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs @@ -1,7 +1,7 @@ -using Interpreter.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Values; using Xunit; -namespace Interpreter.Tests.Unit.BackEnd; +namespace HydraScript.Tests.Unit.BackEnd; public class ValuesTests { @@ -9,7 +9,7 @@ public class ValuesTests public void ConstantNotEqualToNameTest() { var name = new Name("a"); - var constant = new Constant("a", "a"); + var constant = new Constant("a"); Assert.False(name.Equals(constant)); Assert.False(constant.Equals(name)); @@ -37,7 +37,7 @@ public void NameEqualsCorrectTest() [Fact] public void ConstantEqualsCorrectTest() { - var constant1 = new Constant(1, "1"); + var constant1 = new Constant(1); var constant2 = new Constant(1, "1.0"); Assert.True(constant1.Equals(constant2)); diff --git a/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs b/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs new file mode 100644 index 00000000..387d9d99 --- /dev/null +++ b/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs @@ -0,0 +1,158 @@ +#nullable enable +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Values; +using HydraScript.Tests.Helpers; +using Moq; +using Xunit; + +namespace HydraScript.Tests.Unit.BackEnd; + +public class VirtualMachineTests +{ + private readonly VirtualMachine _vm; + + public VirtualMachineTests() + { + _vm = new(new(), new(), new(), TextWriter.Null); + } + + [Fact] + public void CorrectPrintToOutTest() + { + var writer = new Mock(); + writer.Setup(x => x.WriteLine(It.IsAny())) + .Verifiable(); + + var vm = new VirtualMachine(new(), new Stack(new[] { new Frame(new HashAddress(0)) }), new(), writer.Object); + var print = new Print(new Constant(223)) + { + Address = new HashAddress(1) + }; + + print.Execute(vm); + writer.Verify(x => x.WriteLine( + It.Is(v => v!.Equals(223)) + ), Times.Once()); + } + + [Fact] + public void ProgramWithoutHaltWillNotRunTest() + { + var program = new AddressedInstructions(); + Assert.Throws(() => _vm.Run(program)); + + program.Add(new Halt()); + Assert.Null(Record.Exception(() => _vm.Run(program))); + } + + [Fact] + public void VirtualMachineFramesClearedAfterExecutionTest() + { + var program = new List + { + new Simple("a", (new Constant(1), new Constant(2)), "+"), + new AsString(new Name("a")) + { + Left = "s" + }, + new Halt() + }.ToAddressedInstructions(); + + _vm.Run(program); + Assert.Empty(_vm.Frames); + } + + [Fact] + public void VirtualMachineHandlesRecursionTest() + { + var halt = new Mock().Trackable(); + var factorial = new FunctionInfo("fact"); + var program = new AddressedInstructions + { + new Goto(factorial.End), + { new BeginBlock(BlockType.Function, blockId: factorial.ToString()), factorial.Start.Name }, + new Simple("_t2", (new Name("n"), new Constant(2)), "<"), + new IfNotGoto(new Name("_t2"), new Label("5")), + new Return(new Name("n")), + { new Simple("_t5", (new Name("n"), new Constant(1)), "-"), "5" }, + new PushParameter("n", new Name("_t5")), + new CallFunction(factorial, 1, true) + { + Left = "f" + }, + new Simple("_t8", (new Name("n"), new Name("f")), "*"), + new Return(new Name("_t8")), + { new EndBlock(BlockType.Function, blockId: factorial.ToString()), factorial.End.Name }, + new PushParameter("n", new Constant(6)), + new CallFunction(factorial, 1, true) + { + Left = "fa6" + }, + halt.Object + }; + + _vm.Run(program); + Assert.Empty(_vm.CallStack); + Assert.Empty(_vm.Arguments); + halt.Verify(x => x.Execute( + It.Is( + vm => Convert.ToInt32(vm.Frames.Peek()["fa6"]) == 720 + ) + ), Times.Once()); + _vm.Frames.Pop(); + } + + [Fact] + public void CreateArrayReservesCertainSpaceTest() + { + var vm = new VirtualMachine(); + vm.Frames.Push(new Frame(new HashAddress(0))); + + var createArray = new CreateArray("arr", 6) + { + Address = new HashAddress(1) + }; + createArray.Execute(vm); + Assert.Equal(6, ((List) vm.Frames.Peek()["arr"]).Count); + + var indexAssignment = new IndexAssignment("arr", new Constant(0), new Constant(0)) + { + Address = new HashAddress(2) + }; + indexAssignment.Execute(vm); + Assert.Equal(0, ((List) vm.Frames.Peek()["arr"])[0]); + + var removeFromArray = new RemoveFromArray("arr", new Constant(5)) + { + Address = new HashAddress(3) + }; + removeFromArray.Execute(vm); + Assert.Equal(5, ((List) vm.Frames.Peek()["arr"]).Count); + } + + [Fact] + public void ObjectCreationTest() + { + var halt = new Mock().Trackable(); + var program = new List + { + new CreateObject("obj"), + new DotAssignment("obj", new Constant("prop"), new Constant(null, "null")), + halt.Object + }.ToAddressedInstructions(); + + _vm.Run(program); + halt.Verify(x => x.Execute( + It.Is( + vm => ((Dictionary)vm.Frames.Peek()["obj"])["prop"] == null + ) + ), Times.Once()); + _vm.Frames.Pop(); + } +} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/FrontEnd/LexerTests.cs b/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs similarity index 84% rename from Interpreter.Tests/Unit/FrontEnd/LexerTests.cs rename to HydraScript.Tests/Unit/FrontEnd/LexerTests.cs index fe187cb8..41da0480 100644 --- a/Interpreter.Tests/Unit/FrontEnd/LexerTests.cs +++ b/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs @@ -1,10 +1,10 @@ -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Impl; -using Interpreter.Services.Providers.Impl.StructureProvider; -using Interpreter.Tests.TestData; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Services.Providers.StructureProvider.Impl; +using HydraScript.Tests.TestData; using Xunit; -namespace Interpreter.Tests.Unit.FrontEnd; +namespace HydraScript.Tests.Unit.FrontEnd; public class LexerTests { diff --git a/Interpreter.Tests/Unit/FrontEnd/ParserTests.cs b/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs similarity index 66% rename from Interpreter.Tests/Unit/FrontEnd/ParserTests.cs rename to HydraScript.Tests/Unit/FrontEnd/ParserTests.cs index 2628b567..ebb513c8 100644 --- a/Interpreter.Tests/Unit/FrontEnd/ParserTests.cs +++ b/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs @@ -1,11 +1,11 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Impl; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.FrontEnd.TopDownParse.Impl; -using Interpreter.Services.Providers.Impl.StructureProvider; -using Interpreter.Tests.TestData; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.FrontEnd.TopDownParse.Impl; +using HydraScript.Services.Providers.StructureProvider.Impl; +using HydraScript.Tests.TestData; using Xunit; -namespace Interpreter.Tests.Unit.FrontEnd; +namespace HydraScript.Tests.Unit.FrontEnd; public class ParserTests { diff --git a/Interpreter.Tests/Unit/FrontEnd/StructureTests.cs b/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs similarity index 80% rename from Interpreter.Tests/Unit/FrontEnd/StructureTests.cs rename to HydraScript.Tests/Unit/FrontEnd/StructureTests.cs index 9035b6a5..4e822857 100644 --- a/Interpreter.Tests/Unit/FrontEnd/StructureTests.cs +++ b/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs @@ -1,8 +1,8 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; using Xunit; -namespace Interpreter.Tests.Unit.FrontEnd; +namespace HydraScript.Tests.Unit.FrontEnd; public class StructureTests { diff --git a/HydraScript.Tests/Unit/IR/AstNodeTests.cs b/HydraScript.Tests/Unit/IR/AstNodeTests.cs new file mode 100644 index 00000000..55367f6d --- /dev/null +++ b/HydraScript.Tests/Unit/IR/AstNodeTests.cs @@ -0,0 +1,31 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using Xunit; + +namespace HydraScript.Tests.Unit.IR; + +public class AstNodeTests +{ + [Fact] + public void PrecedenceTest() + { + var lexicalDecl = new LexicalDeclaration(false); + var stmtItemList = new List + { + lexicalDecl + }; + // ReSharper disable once UnusedVariable + var func = new FunctionDeclaration( + name: new IdentifierReference(name: Guid.NewGuid().ToString()), + new TypeIdentValue( + TypeId: new IdentifierReference( + name: Guid.NewGuid().ToString())), + arguments: new List(), + new BlockStatement(stmtItemList)); + + Assert.True(lexicalDecl.ChildOf()); + } +} \ No newline at end of file diff --git a/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs b/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs new file mode 100644 index 00000000..8433b945 --- /dev/null +++ b/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs @@ -0,0 +1,41 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +using Moq; +using Xunit; + +namespace HydraScript.Tests.Unit.IR; + +public class FunctionWithUndefinedReturnStorageTests +{ + [Fact] + public void StorageIsEmptyAfterFlushTest() + { + const string functionName = nameof(functionName); + IFunctionWithUndefinedReturnStorage storage = new FunctionWithUndefinedReturnStorage(); + + var symbol = new FunctionSymbol( + id: functionName, + parameters: new List(), + "undefined", + isEmpty: false); + + var decl = new FunctionDeclaration( + name: new IdentifierReference(functionName), + returnTypeValue: Mock.Of(), + arguments: new List(), + new BlockStatement(new List())); + + storage.Save(symbol, decl); + + var declarations = storage.Flush(); + Assert.Contains(decl, declarations); + + Assert.Empty(storage.Flush()); + } +} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/IR/SymbolTableTests.cs b/HydraScript.Tests/Unit/IR/SymbolTableTests.cs similarity index 83% rename from Interpreter.Tests/Unit/IR/SymbolTableTests.cs rename to HydraScript.Tests/Unit/IR/SymbolTableTests.cs index d526c30d..4f52e041 100644 --- a/Interpreter.Tests/Unit/IR/SymbolTableTests.cs +++ b/HydraScript.Tests/Unit/IR/SymbolTableTests.cs @@ -1,10 +1,10 @@ -using Interpreter.Lib.IR.Ast.Nodes; -using Interpreter.Lib.IR.CheckSemantics.Variables; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; using Moq; using Xunit; -namespace Interpreter.Tests.Unit.IR; +namespace HydraScript.Tests.Unit.IR; public class SymbolTableTests { @@ -14,7 +14,7 @@ public void FindSymbolTest() const string id = "ident"; var type = new Mock(id); - var symbol = new Mock(id, type.Object); + var symbol = new Mock(); symbol.Setup(s => s.Id).Returns(id); symbol.Setup(s => s.Type).Returns(type.Object); @@ -46,7 +46,7 @@ public void FlatteningScopeTest() const string id = "ident"; var type = new Mock(id); - var symbol = new Mock(id, type.Object); + var symbol = new Mock(); symbol.Setup(s => s.Id).Returns(id); symbol.Setup(s => s.Type).Returns(type.Object); diff --git a/Interpreter.Tests/Unit/IR/Types/ObjectTypeTests.cs b/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs similarity index 73% rename from Interpreter.Tests/Unit/IR/Types/ObjectTypeTests.cs rename to HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs index 73422c99..79db637e 100644 --- a/Interpreter.Tests/Unit/IR/Types/ObjectTypeTests.cs +++ b/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs @@ -1,7 +1,7 @@ -using Interpreter.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Types; using Xunit; -namespace Interpreter.Tests.Unit.IR.Types; +namespace HydraScript.Tests.Unit.IR.Types; public class ObjectTypeTests { @@ -50,7 +50,6 @@ public void RecursiveTypeReferenceResolvingTest() { var number = new Type("number"); var array = new ArrayType(new Type("self")); - var method = new FunctionType(number, new List { new("self") }); var nullable = new NullableType(new Type("self")); var linkedListType = new ObjectType( new List @@ -61,17 +60,15 @@ public void RecursiveTypeReferenceResolvingTest() new("next", new Type("self")) })), new("children", array), - new("parent", nullable), - new("compare", method) + new("parent", nullable) } ); - linkedListType.ResolveSelfReferences("self"); + linkedListType.ResolveReference(linkedListType, refId: "self"); Assert.Equal(linkedListType, ((ObjectType)linkedListType["wrapped"])["next"]); Assert.Equal(linkedListType, array.Type); Assert.Equal(linkedListType, nullable.Type); - Assert.Equal(linkedListType, method.Arguments[0]); } [Fact] @@ -86,7 +83,10 @@ public void NonSpecifiedTypesVisitingTest() new("prop", new Type("number")) } ); - var ex = Record.Exception(() => objectType.ResolveSelfReferences("self")); + var ex = Record.Exception( + () => objectType.ResolveReference( + objectType, + refId: "self")); Assert.Null(ex); Assert.Equal(objectType["next"], objectType); } @@ -96,7 +96,6 @@ public void ObjectTypeToStringTest() { var number = new Type("number"); var array = new ArrayType(new Type("self")); - var method = new FunctionType(number, new List { new("self") }); var nullable = new NullableType(new Type("self")); var linkedListType = new ObjectType( new List @@ -107,12 +106,12 @@ public void ObjectTypeToStringTest() new("next", new Type("self")) })), new("children", array), - new("parent", nullable), - new("compare", method) + new("parent", nullable) } ); - - linkedListType.ResolveSelfReferences("self"); + + linkedListType.ResolveReference(linkedListType, refId: "self"); + Assert.Contains("@this", linkedListType.ToString()); } @@ -125,23 +124,17 @@ public void SerializationOfTypeWithRecursivePropertyTest() new("data", new Type("number")), new("next", new Type("self")) } - ) { Recursive = true }; - nodeType.ResolveSelfReferences("self"); + ); + nodeType.ResolveReference(nodeType, refId: "self"); var linkedListType = new ObjectType( new List { - new("head", nodeType), - new("append", new FunctionType( - new Type("void"), - new List { nodeType } - ) - ), - new("copy", new FunctionType(new Type("self"), Array.Empty())) + new("head", nodeType) } - ) { Recursive = true }; - linkedListType.ResolveSelfReferences("self"); + ); + linkedListType.ResolveReference(linkedListType, refId: "self"); - Assert.Contains("head: head;", linkedListType.ToString()); + Assert.Contains("next: next;", linkedListType.ToString()); } } \ No newline at end of file diff --git a/Interpreter.Tests/Unit/IR/Types/TypeTests.cs b/HydraScript.Tests/Unit/IR/Types/TypeTests.cs similarity index 68% rename from Interpreter.Tests/Unit/IR/Types/TypeTests.cs rename to HydraScript.Tests/Unit/IR/Types/TypeTests.cs index 1593de75..3462dc33 100644 --- a/Interpreter.Tests/Unit/IR/Types/TypeTests.cs +++ b/HydraScript.Tests/Unit/IR/Types/TypeTests.cs @@ -1,7 +1,8 @@ -using Interpreter.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; using Xunit; -namespace Interpreter.Tests.Unit.IR.Types; +namespace HydraScript.Tests.Unit.IR.Types; public class TypeTests { @@ -42,8 +43,9 @@ public void TypeWrappingTest() [Fact] public void DefaultValueTest() { - Assert.Null(TypeUtils.GetDefaultValue(new NullableType(new Any()))); - Assert.Null(TypeUtils.GetDefaultValue(new NullType())); - Assert.Null(TypeUtils.GetDefaultValue(new ObjectType(new List()))); + var calculator = new DefaultValueForTypeCalculator(); + Assert.Null(calculator.GetDefaultValueForType(new NullableType(new Any()))); + Assert.Null(calculator.GetDefaultValueForType(new NullType())); + Assert.Null(calculator.GetDefaultValueForType(new ObjectType(new List()))); } } \ No newline at end of file diff --git a/Interpreter.Tests/Unit/Infrastructure/ExecutorTests.cs b/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs similarity index 81% rename from Interpreter.Tests/Unit/Infrastructure/ExecutorTests.cs rename to HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs index 3c0d04f3..713ca87e 100644 --- a/Interpreter.Tests/Unit/Infrastructure/ExecutorTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs @@ -1,15 +1,16 @@ -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.IR.Ast; -using Interpreter.Services.Executor.Impl; -using Interpreter.Services.Parsing; -using Interpreter.Tests.Stubs; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.IR.Ast; +using HydraScript.Services.Executor.Impl; +using HydraScript.Services.Parsing; +using HydraScript.Tests.Helpers; +using HydraScript.Tests.Stubs; using Moq; using Xunit; -namespace Interpreter.Tests.Unit.Infrastructure; +namespace HydraScript.Tests.Unit.Infrastructure; public class ExecutorTests { @@ -30,7 +31,7 @@ public void ExecuteGoesOkTest() { var ast = new Mock(); ast.Setup(x => x.GetInstructions()) - .Returns(new List { new Halt(0) }); + .Returns(new AddressedInstructions { new Halt() }); _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); @@ -76,13 +77,13 @@ public void ParserExceptionCaughtTest() [Fact] public void InternalInterpreterErrorCaughtTest() { - var instruction = new Mock(MockBehavior.Default, 0); + var instruction = new Mock(); instruction.Setup(x => x.Execute(It.IsAny())) .Throws(); var ast = new Mock(); ast.Setup(x => x.GetInstructions()) - .Returns(new List { instruction.Object, new Halt(1) }); + .Returns(new AddressedInstructions { instruction.Object, new Halt() }); _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); diff --git a/Interpreter.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs b/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs similarity index 84% rename from Interpreter.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs rename to HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs index 53e63e33..1d97f9d5 100644 --- a/Interpreter.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs @@ -1,15 +1,16 @@ using System.IO.Abstractions; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.IR.Ast; -using Interpreter.Services.Providers.Impl.LexerProvider; -using Interpreter.Services.Providers.Impl.ParserProvider; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.IR.Ast; +using HydraScript.Services.Providers.LexerProvider.Impl; +using HydraScript.Services.Providers.ParserProvider.Impl; using Moq; using Xunit; -namespace Interpreter.Tests.Unit.Infrastructure; +namespace HydraScript.Tests.Unit.Infrastructure; public class LoggingEntitiesTests { @@ -76,7 +77,7 @@ public void CorrectFileNameProducedByTreeTest() { var ast = new Mock(); ast.Setup(x => x.GetInstructions()) - .Returns(new List { new Halt(0) }); + .Returns(new AddressedInstructions { new Halt() }); _file.Setup(x => x.WriteAllLines( It.IsAny(), It.IsAny>() @@ -87,7 +88,7 @@ public void CorrectFileNameProducedByTreeTest() _file.Verify(x => x.WriteAllLines( It.Is(p => p == "file.tac"), - It.Is>(c => c.SequenceEqual(new[] { "0: End" })) + It.Is>(c => c.SequenceEqual(new[] { "\tEnd" })) ), Times.Once()); } } \ No newline at end of file diff --git a/Interpreter.Tests/Unit/Infrastructure/ParsingServiceTests.cs b/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs similarity index 77% rename from Interpreter.Tests/Unit/Infrastructure/ParsingServiceTests.cs rename to HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs index d9ee4fd6..37f4393b 100644 --- a/Interpreter.Tests/Unit/Infrastructure/ParsingServiceTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs @@ -1,11 +1,11 @@ -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.IR.Ast; -using Interpreter.Services.Parsing.Impl; -using Interpreter.Services.Providers; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.IR.Ast; +using HydraScript.Services.Parsing.Impl; +using HydraScript.Services.Providers.ParserProvider; using Moq; using Xunit; -namespace Interpreter.Tests.Unit.Infrastructure; +namespace HydraScript.Tests.Unit.Infrastructure; public class ParsingServiceTests { diff --git a/Interpreter.Tests/Unit/Infrastructure/ProvidersTests.cs b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs similarity index 77% rename from Interpreter.Tests/Unit/Infrastructure/ProvidersTests.cs rename to HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs index 1d7a103a..8a3e14a2 100644 --- a/Interpreter.Tests/Unit/Infrastructure/ProvidersTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs @@ -1,17 +1,18 @@ -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; -using Interpreter.Lib.FrontEnd.GetTokens.Impl; -using Interpreter.Lib.FrontEnd.TopDownParse.Impl; -using Interpreter.Services.Providers; -using Interpreter.Services.Providers.Impl.LexerProvider; -using Interpreter.Services.Providers.Impl.ParserProvider; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Lib.FrontEnd.TopDownParse.Impl; +using HydraScript.Services.Providers.LexerProvider; +using HydraScript.Services.Providers.LexerProvider.Impl; +using HydraScript.Services.Providers.ParserProvider.Impl; +using HydraScript.Services.Providers.StructureProvider; using Microsoft.Extensions.Options; using Moq; using Xunit; using SystemType = System.Type; -namespace Interpreter.Tests.Unit.Infrastructure; +namespace HydraScript.Tests.Unit.Infrastructure; public class ProvidersTests { diff --git a/Interpreter/CommandLineSettings.cs b/HydraScript/CommandLineSettings.cs similarity index 94% rename from Interpreter/CommandLineSettings.cs rename to HydraScript/CommandLineSettings.cs index a56c9ea6..3d9e4c2e 100644 --- a/Interpreter/CommandLineSettings.cs +++ b/HydraScript/CommandLineSettings.cs @@ -2,7 +2,7 @@ using CommandLine; using CommandLine.Text; -namespace Interpreter; +namespace HydraScript; [SuppressMessage("ReSharper", "UnusedMember.Global")] [SuppressMessage("ReSharper", "PropertyCanBeMadeInitOnly.Global")] @@ -16,7 +16,7 @@ public class CommandLineSettings [Option('d', "dump", Default = false, HelpText = "Show dump data of interpreter")] public virtual bool Dump { get; set; } - [Usage(ApplicationAlias = "Interpreter")] + [Usage(ApplicationAlias = "HydraScript")] public static IEnumerable Examples { get diff --git a/Interpreter/Interpreter.csproj b/HydraScript/HydraScript.csproj similarity index 86% rename from Interpreter/Interpreter.csproj rename to HydraScript/HydraScript.csproj index c6708e46..4a9d0b3b 100644 --- a/Interpreter/Interpreter.csproj +++ b/HydraScript/HydraScript.csproj @@ -8,14 +8,14 @@ - + - - + + diff --git a/Interpreter/Program.cs b/HydraScript/Program.cs similarity index 72% rename from Interpreter/Program.cs rename to HydraScript/Program.cs index 4c450e67..bf58d911 100644 --- a/Interpreter/Program.cs +++ b/HydraScript/Program.cs @@ -1,17 +1,19 @@ using System.Diagnostics.CodeAnalysis; using CommandLine; +using HydraScript.Services.Executor; +using HydraScript.Services.Executor.Impl; +using HydraScript.Services.Parsing; +using HydraScript.Services.Parsing.Impl; +using HydraScript.Services.Providers.LexerProvider; +using HydraScript.Services.Providers.LexerProvider.Impl; +using HydraScript.Services.Providers.ParserProvider; +using HydraScript.Services.Providers.ParserProvider.Impl; +using HydraScript.Services.Providers.StructureProvider; +using HydraScript.Services.Providers.StructureProvider.Impl; using Microsoft.Extensions.DependencyInjection; -using Interpreter.Services.Executor; -using Interpreter.Services.Executor.Impl; -using Interpreter.Services.Parsing; -using Interpreter.Services.Parsing.Impl; -using Interpreter.Services.Providers; -using Interpreter.Services.Providers.Impl.LexerProvider; -using Interpreter.Services.Providers.Impl.ParserProvider; -using Interpreter.Services.Providers.Impl.StructureProvider; using Microsoft.Extensions.Options; -namespace Interpreter; +namespace HydraScript; [ExcludeFromCodeCoverage] public static class Program diff --git a/Interpreter/Services/Executor/IExecutor.cs b/HydraScript/Services/Executor/IExecutor.cs similarity index 55% rename from Interpreter/Services/Executor/IExecutor.cs rename to HydraScript/Services/Executor/IExecutor.cs index f2f22248..bc9711ed 100644 --- a/Interpreter/Services/Executor/IExecutor.cs +++ b/HydraScript/Services/Executor/IExecutor.cs @@ -1,4 +1,4 @@ -namespace Interpreter.Services.Executor; +namespace HydraScript.Services.Executor; public interface IExecutor { diff --git a/Interpreter/Services/Executor/Impl/Executor.cs b/HydraScript/Services/Executor/Impl/Executor.cs similarity index 74% rename from Interpreter/Services/Executor/Impl/Executor.cs rename to HydraScript/Services/Executor/Impl/Executor.cs index 9b12c337..738ee018 100644 --- a/Interpreter/Services/Executor/Impl/Executor.cs +++ b/HydraScript/Services/Executor/Impl/Executor.cs @@ -1,11 +1,11 @@ -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Services.Parsing; +using HydraScript.Services.Parsing; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; using Microsoft.Extensions.Options; -namespace Interpreter.Services.Executor.Impl; +namespace HydraScript.Services.Executor.Impl; public class Executor : IExecutor { @@ -35,7 +35,7 @@ public void Execute() } catch (Exception ex) { - Console.WriteLine("Internal Interpreter Error"); + Console.WriteLine("Internal HydraScript Error"); Console.WriteLine(ex); } } diff --git a/Interpreter/Services/Parsing/IParsingService.cs b/HydraScript/Services/Parsing/IParsingService.cs similarity index 53% rename from Interpreter/Services/Parsing/IParsingService.cs rename to HydraScript/Services/Parsing/IParsingService.cs index 7b9249e2..fbe4a389 100644 --- a/Interpreter/Services/Parsing/IParsingService.cs +++ b/HydraScript/Services/Parsing/IParsingService.cs @@ -1,6 +1,6 @@ -using Interpreter.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast; -namespace Interpreter.Services.Parsing; +namespace HydraScript.Services.Parsing; public interface IParsingService { diff --git a/Interpreter/Services/Parsing/Impl/ParsingService.cs b/HydraScript/Services/Parsing/Impl/ParsingService.cs similarity index 74% rename from Interpreter/Services/Parsing/Impl/ParsingService.cs rename to HydraScript/Services/Parsing/Impl/ParsingService.cs index 2c24a572..57a775a8 100644 --- a/Interpreter/Services/Parsing/Impl/ParsingService.cs +++ b/HydraScript/Services/Parsing/Impl/ParsingService.cs @@ -1,7 +1,7 @@ -using Interpreter.Lib.IR.Ast; -using Interpreter.Services.Providers; +using HydraScript.Services.Providers.ParserProvider; +using HydraScript.Lib.IR.Ast; -namespace Interpreter.Services.Parsing.Impl; +namespace HydraScript.Services.Parsing.Impl; public class ParsingService : IParsingService { diff --git a/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs b/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs new file mode 100644 index 00000000..58f3f5c5 --- /dev/null +++ b/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.FrontEnd.GetTokens; + +namespace HydraScript.Services.Providers.LexerProvider; + +public interface ILexerProvider +{ + ILexer CreateLexer(); +} \ No newline at end of file diff --git a/Interpreter/Services/Providers/Impl/LexerProvider/LexerProvider.cs b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs similarity index 77% rename from Interpreter/Services/Providers/Impl/LexerProvider/LexerProvider.cs rename to HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs index 4ff77b32..7ac47e3e 100644 --- a/Interpreter/Services/Providers/Impl/LexerProvider/LexerProvider.cs +++ b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs @@ -1,9 +1,10 @@ using System.IO.Abstractions; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Services.Providers.StructureProvider; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; using Microsoft.Extensions.Options; -namespace Interpreter.Services.Providers.Impl.LexerProvider; +namespace HydraScript.Services.Providers.LexerProvider.Impl; public class LexerProvider : ILexerProvider { diff --git a/Interpreter/Services/Providers/Impl/LexerProvider/LoggingLexer.cs b/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs similarity index 83% rename from Interpreter/Services/Providers/Impl/LexerProvider/LoggingLexer.cs rename to HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs index ed297b16..33a0bc74 100644 --- a/Interpreter/Services/Providers/Impl/LexerProvider/LoggingLexer.cs +++ b/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.IO.Abstractions; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace Interpreter.Services.Providers.Impl.LexerProvider; +namespace HydraScript.Services.Providers.LexerProvider.Impl; public class LoggingLexer : ILexer { diff --git a/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs b/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs new file mode 100644 index 00000000..a846c091 --- /dev/null +++ b/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.FrontEnd.TopDownParse; + +namespace HydraScript.Services.Providers.ParserProvider; + +public interface IParserProvider +{ + IParser CreateParser(); +} \ No newline at end of file diff --git a/Interpreter/Services/Providers/Impl/ParserProvider/LoggingAbstractSyntaxTree.cs b/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs similarity index 70% rename from Interpreter/Services/Providers/Impl/ParserProvider/LoggingAbstractSyntaxTree.cs rename to HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs index b8160dbc..6db8a936 100644 --- a/Interpreter/Services/Providers/Impl/ParserProvider/LoggingAbstractSyntaxTree.cs +++ b/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs @@ -1,8 +1,8 @@ using System.IO.Abstractions; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast; -namespace Interpreter.Services.Providers.Impl.ParserProvider; +namespace HydraScript.Services.Providers.ParserProvider.Impl; public class LoggingAbstractSyntaxTree : IAbstractSyntaxTree { @@ -17,12 +17,12 @@ public LoggingAbstractSyntaxTree(IAbstractSyntaxTree ast, string fileName, IFile _fileSystem = fileSystem; } - public List GetInstructions() + public AddressedInstructions GetInstructions() { var instructions = _ast.GetInstructions(); _fileSystem.File.WriteAllLines( $"{_fileName}.tac", - instructions.OrderBy(i => i).Select(i => i.ToString()) + instructions.Select(i => i.ToString()) ); return instructions; } diff --git a/Interpreter/Services/Providers/Impl/ParserProvider/LoggingParser.cs b/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs similarity index 83% rename from Interpreter/Services/Providers/Impl/ParserProvider/LoggingParser.cs rename to HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs index 3fd04d97..93a92d85 100644 --- a/Interpreter/Services/Providers/Impl/ParserProvider/LoggingParser.cs +++ b/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs @@ -1,8 +1,8 @@ using System.IO.Abstractions; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Interpreter.Lib.IR.Ast; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.IR.Ast; -namespace Interpreter.Services.Providers.Impl.ParserProvider; +namespace HydraScript.Services.Providers.ParserProvider.Impl; public class LoggingParser : IParser { diff --git a/Interpreter/Services/Providers/Impl/ParserProvider/ParserProvider.cs b/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs similarity index 76% rename from Interpreter/Services/Providers/Impl/ParserProvider/ParserProvider.cs rename to HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs index 25b5b3a2..924c9d79 100644 --- a/Interpreter/Services/Providers/Impl/ParserProvider/ParserProvider.cs +++ b/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs @@ -1,9 +1,10 @@ using System.IO.Abstractions; -using Interpreter.Lib.FrontEnd.TopDownParse; -using Parser = Interpreter.Lib.FrontEnd.TopDownParse.Impl.Parser; +using HydraScript.Services.Providers.LexerProvider; +using HydraScript.Lib.FrontEnd.TopDownParse; +using HydraScript.Lib.FrontEnd.TopDownParse.Impl; using Microsoft.Extensions.Options; -namespace Interpreter.Services.Providers.Impl.ParserProvider; +namespace HydraScript.Services.Providers.ParserProvider.Impl; public class ParserProvider : IParserProvider { diff --git a/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs b/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs new file mode 100644 index 00000000..8f4521ea --- /dev/null +++ b/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Lib.FrontEnd.GetTokens.Data; + +namespace HydraScript.Services.Providers.StructureProvider; + +public interface IStructureProvider +{ + Structure CreateStructure(); +} \ No newline at end of file diff --git a/Interpreter/Services/Providers/Impl/StructureProvider/StructureProvider.cs b/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs similarity index 87% rename from Interpreter/Services/Providers/Impl/StructureProvider/StructureProvider.cs rename to HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs index 90f5e186..d03b5cd3 100644 --- a/Interpreter/Services/Providers/Impl/StructureProvider/StructureProvider.cs +++ b/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs @@ -1,10 +1,10 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -namespace Interpreter.Services.Providers.Impl.StructureProvider; +namespace HydraScript.Services.Providers.StructureProvider.Impl; public class StructureProvider : IStructureProvider { @@ -41,6 +41,6 @@ public override Structure Read(ref Utf8JsonReader reader, public override void Write(Utf8JsonWriter writer, Structure value, JsonSerializerOptions options) => - throw new NotImplementedException(); + throw new NotSupportedException(); } } \ No newline at end of file diff --git a/Interpreter/TokenTypes.cs b/HydraScript/TokenTypes.cs similarity index 95% rename from Interpreter/TokenTypes.cs rename to HydraScript/TokenTypes.cs index f604bdba..dc86c0a4 100644 --- a/Interpreter/TokenTypes.cs +++ b/HydraScript/TokenTypes.cs @@ -1,4 +1,4 @@ -namespace Interpreter; +namespace HydraScript; public static class TokenTypes { @@ -51,11 +51,6 @@ public static class TokenTypes "pattern": "[+]{1,2}|[-]|[*]|[\/]|[%]|([!]|[=])[=]|([<]|[>])[=]?|[!]|[|]{2}|[&]{2}|[~]|[:]{2}", "priority": 12 }, - { - "tag": "Arrow", - "pattern": "[=][>]", - "priority": 13 - }, { "tag": "Comma", "pattern": "[,]", diff --git a/Interpreter/grammar.txt b/HydraScript/grammar.txt similarity index 69% rename from Interpreter/grammar.txt rename to HydraScript/grammar.txt index a6eec2fc..0546398d 100644 --- a/Interpreter/grammar.txt +++ b/HydraScript/grammar.txt @@ -10,31 +10,37 @@ Statement -> BlockStatement ContinueStatement BreakStatement ReturnStatement - TypeStatement Declaration -> LexicalDeclaration FunctionDeclaration + TypeDeclaration BlockStatement -> '{' StatementList '}' ExpressionStatement -> Expression -Expression -> AssignExpression -AssignExpression -> LeftHandSideExpression ('=' AssignExpression)? -LeftHandSideExpression -> CastExpression +Expression -> CastExpression + AssignmentExpression + +CastExpression -> ConditionalExpression 'as' 'string' + +AssignmentExpression -> LeftHandSideExpression '=' Expression + +LeftHandSideExpression -> MemberExpression CallExpression -CallExpression -> MemberExpression Arguments* -Arguments -> '(' ArgumentsList? ')' -ArgumentsList -> AssignExpression (',' AssignExpression)* -MemberExpression -> "Ident" ('[' Expression ']' | '.' "Ident" )* -CastExpression -> ConditionalExpression 'as' TypeIdentifier -ConditionalExpression -> OrExpression ('?' AssignExpression ':' AssignExpression)? +CallExpression -> MemberExpression Arguments (Arguments | '[' Expression ']' | '.' 'Ident')* +MemberExpression -> "Ident" ('[' Expression ']' | '.' 'Ident')* + +Arguments -> '(' (Expression ',')* ')' + +ConditionalExpression -> OrExpression ('?' Expression ':' Expression)? OrExpression -> AndExpression ('||' AndExpression)* AndExpression -> EqExpression ('&&' EqExpression)* EqExpression -> RelExpression (('=='|'!=') RelExpression)* RelExpression -> AddExpression (('<'|'>'|'<='|'>=') AddExpression)* AddExpression -> MulExpression (('+'|'-') MulExpression)* -MulExpression -> UnaryExpression (('*'|'/'|'%') UnaryExpression)* -UnaryExpression -> PrimaryExpression | ('-'|'!') UnaryExpression +MulExpression -> UnaryExpression (('*'|'/'|'%'|'++'|'::') UnaryExpression)* +UnaryExpression -> LeftHandSideExpression | ('-'|'!'|'~') UnaryExpression + PrimaryExpression -> "Ident" | Literal | '(' Expression ')' | ObjectLiteral | ArrayLiteral Literal -> "NullLiteral" "IntegerLiteral" @@ -42,12 +48,9 @@ Literal -> "NullLiteral" "StringLiteral" "BooleanLiteral" ObjectLiteral -> '{' PropertyDefinitionList '}' -PropertyDefinitionList -> (Property ';')* -Property -> FieldProperty - MethodProperty +PropertyDefinitionList -> (FieldProperty ';')* FieldProperty -> "Ident" ':' Expression -MethodProperty -> "Ident" '=>' MethodDeclaration -MethodDeclaration -> '(' FunctionParameters? ')' Type? BlockStatement + ArrayLiteral -> '[' ElementList ']' ElementList -> (Expression ',')* @@ -61,15 +64,13 @@ BreakStatement -> 'break' ReturnStatement -> 'return' Expression? -TypeStatement -> 'type' "Ident" = TypeValue +TypeDeclaration -> 'type' "Ident" = TypeValue TypeValue -> TypeValueBase TypeValueSuffix* TypeValueBase -> "Ident" - FunctionTypeBase ObjectTypeBase ObjectTypeBase -> '{' PropertyTypeList '}' PropertyTypeList -> (PropertyType ';')* PropertyType -> "Ident" ':' TypeValue -FunctionTypeBase -> '(' ArgTypeList ')' '=>' TypeValue ArgTypeList -> (TypeValue ',')* TypeValueSuffix -> '['']' '?' diff --git a/Interpreter.Lib/BackEnd/Instructions/AsString.cs b/Interpreter.Lib/BackEnd/Instructions/AsString.cs deleted file mode 100644 index 333eca74..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/AsString.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.Json; -using System.Text.Json.Serialization; -using Interpreter.Lib.BackEnd.Values; -using SystemType = System.Type; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class AsString : Simple -{ - public AsString(string left, IValue right, int number) : - base(left, (null, right), "", number) - { - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - frame[Left] = JsonSerializer.Serialize( - right.right.Get(frame), - new JsonSerializerOptions - { - WriteIndented = true, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - ReferenceHandler = ReferenceHandler.IgnoreCycles, - Converters = { new DoubleValueWriteConverter() }, - NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals - } - ); - - return Jump(); - } - - protected override string ToStringRepresentation() => $"{Left} = {right.right} as string"; - - [ExcludeFromCodeCoverage] - private class DoubleValueWriteConverter : JsonConverter - { - public override double Read(ref Utf8JsonReader reader, - SystemType typeToConvert, JsonSerializerOptions options) => - throw new NotImplementedException(); - - public override void Write(Utf8JsonWriter writer, - double value, JsonSerializerOptions options) - { - // ReSharper disable once CompareOfFloatsByEqualityOperator - if (value == Math.Truncate(value)) - writer.WriteNumberValue(Convert.ToInt64(value)); - else - writer.WriteNumberValue(value); - } - } -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/BeginFunction.cs b/Interpreter.Lib/BackEnd/Instructions/BeginFunction.cs deleted file mode 100644 index 861a8760..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/BeginFunction.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class BeginFunction : Instruction -{ - private readonly FunctionInfo _function; - - public BeginFunction(int number, FunctionInfo function) : base(number) - { - _function = function; - } - - public override int Execute(VirtualMachine vm) => Number + 1; - - protected override string ToStringRepresentation() => $"BeginFunction {_function.CallId()}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/CallFunction.cs b/Interpreter.Lib/BackEnd/Instructions/CallFunction.cs deleted file mode 100644 index 30f5a128..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/CallFunction.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class CallFunction : Simple -{ - private readonly FunctionInfo _function; - private readonly int _numberOfArguments; - - public CallFunction(FunctionInfo function, int number, int numberOfArguments, string left = null) : - base(left, (null, null), "Call ", number) - { - _function = function; - _numberOfArguments = numberOfArguments + Convert.ToInt32(function.MethodOf != null); - } - - public override int Jump() => _function.Location; - - public override int Execute(VirtualMachine vm) - { - var frame = new Frame(Number + 1, vm.Frames.Peek()); - - var i = 0; - var args = new List<(string Id, object Value)>(); - while (i < _numberOfArguments) - { - args.Add(vm.Arguments.Pop()); - frame[args[i].Id] = args[i].Value; - i++; - } - - if (_function.MethodOf != null) - { - var obj = (Dictionary) frame[_function.MethodOf]; - foreach (var (key, value) in obj) - { - frame[key] = value; - } - } - - vm.CallStack.Push(new Call(Number, _function, args, Left)); - vm.Frames.Push(frame); - return _function.Location; - } - - protected override string ToStringRepresentation() => Left == null - ? $"Call {_function}, {_numberOfArguments}" - : $"{Left} = Call {_function}, {_numberOfArguments}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/CreateArray.cs b/Interpreter.Lib/BackEnd/Instructions/CreateArray.cs deleted file mode 100644 index 6dbf2330..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/CreateArray.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class CreateArray : Instruction -{ - private readonly string _id; - private readonly int _size; - - public CreateArray(int number, string id, int size) : base(number) - { - _id = id; - _size = size; - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - frame[_id] = new object[_size].ToList(); - return Number + 1; - } - - protected override string ToStringRepresentation() => $"array {_id} = [{_size}]"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/CreateObject.cs b/Interpreter.Lib/BackEnd/Instructions/CreateObject.cs deleted file mode 100644 index 973c5be3..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/CreateObject.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class CreateObject : Instruction -{ - private readonly string _id; - - public CreateObject(int number, string id) : base(number) - { - _id = id; - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - frame[_id] = new Dictionary(); - return Number + 1; - } - - protected override string ToStringRepresentation() => $"object {_id} = {{}}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/DotAssignment.cs b/Interpreter.Lib/BackEnd/Instructions/DotAssignment.cs deleted file mode 100644 index 8aaf66b0..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/DotAssignment.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class DotAssignment : Simple -{ - public DotAssignment(string left, (IValue left, IValue right) right, int number) : - base(left, right, ".", number) - { - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - var obj = (Dictionary) frame[Left]; - var field = (string) right.left.Get(frame) ?? string.Empty; - obj[field] = right.right.Get(frame); - return Number + 1; - } - - protected override string ToStringRepresentation() => - $"{Left}{@operator}{right.left} = {right.right}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Goto.cs b/Interpreter.Lib/BackEnd/Instructions/Goto.cs deleted file mode 100644 index e633e7e3..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Goto.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class Goto : Instruction -{ - protected int jump; - - public Goto(int jump, int number) : base(number) - { - this.jump = jump; - } - - public override int Jump() => jump; - - public override int Execute(VirtualMachine vm) => Jump(); - - public void SetJump(int newJump) => jump = newJump; - - protected override string ToStringRepresentation() => $"Goto {Jump()}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Halt.cs b/Interpreter.Lib/BackEnd/Instructions/Halt.cs deleted file mode 100644 index d9cd0002..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Halt.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public class Halt : Instruction -{ - public Halt(int number) : base(number) - { - } - - public override bool End() => true; - - public override int Execute(VirtualMachine vm) - { - vm.Frames.Pop(); - return -3; - } - - protected override string ToStringRepresentation() => "End"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/IfNotGoto.cs b/Interpreter.Lib/BackEnd/Instructions/IfNotGoto.cs deleted file mode 100644 index 64043003..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/IfNotGoto.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class IfNotGoto : Goto -{ - private readonly IValue _test; - - public IfNotGoto(IValue test, int jump, int number) : - base(jump, number) - { - _test = test; - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - if (!Convert.ToBoolean(_test.Get(frame))) - { - return jump; - } - return Number + 1; - } - - protected override string ToStringRepresentation() => $"IfNot {_test} Goto {Jump()}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/IndexAssignment.cs b/Interpreter.Lib/BackEnd/Instructions/IndexAssignment.cs deleted file mode 100644 index 0d37ed03..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/IndexAssignment.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class IndexAssignment : Simple -{ - public IndexAssignment(string left, (IValue left, IValue right) right, int number) : - base(left, right, "[]", number) - { - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - var obj = (List) frame[Left]; - var index = Convert.ToInt32(right.left.Get(frame)); - obj[index] = right.right.Get(frame); - return Number + 1; - } - - protected override string ToStringRepresentation() => - $"{Left}[{right.left}] = {right.right}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Instruction.cs b/Interpreter.Lib/BackEnd/Instructions/Instruction.cs deleted file mode 100644 index c1688613..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Instruction.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Interpreter.Lib.BackEnd.Instructions; - -public abstract class Instruction : IComparable -{ - public int Number { get; } - - protected Instruction(int number) => - Number = number; - - public virtual int Jump() => Number + 1; - - public virtual bool End() => false; - - public abstract int Execute(VirtualMachine vm); - - public int CompareTo(Instruction other) => Number.CompareTo(other.Number); - - protected abstract string ToStringRepresentation(); - - public override string ToString() => $"{Number}: {ToStringRepresentation()}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Print.cs b/Interpreter.Lib/BackEnd/Instructions/Print.cs deleted file mode 100644 index 6fb587bb..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Print.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class Print : Instruction -{ - private readonly IValue _value; - - public Print(int number, IValue value) : base(number) - { - _value = value; - } - - public override int Execute(VirtualMachine vm) - { - vm.Writer.WriteLine(_value.Get(vm.Frames.Peek())); - return Number + 1; - } - - protected override string ToStringRepresentation() => $"Print {_value}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/PushParameter.cs b/Interpreter.Lib/BackEnd/Instructions/PushParameter.cs deleted file mode 100644 index bdacc41e..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/PushParameter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class PushParameter : Instruction -{ - private readonly string _parameter; - private readonly IValue _value; - - public PushParameter( - int number, - string parameter, - IValue value - ) : base(number) - { - _parameter = parameter; - _value = value; - } - - public override int Execute(VirtualMachine vm) - { - vm.Arguments.Push((_parameter, _value.Get(vm.Frames.Peek()))); - return Number + 1; - } - - protected override string ToStringRepresentation() => $"PushParameter {_parameter} = {_value}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/RemoveFromArray.cs b/Interpreter.Lib/BackEnd/Instructions/RemoveFromArray.cs deleted file mode 100644 index e933855e..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/RemoveFromArray.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class RemoveFromArray : Instruction -{ - private readonly string _id; - private readonly IValue _index; - - public RemoveFromArray(int number, string id, IValue index) : base(number) - { - _id = id; - _index = index; - } - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - var list = (List) frame[_id]; - list.RemoveAt(Convert.ToInt32(_index.Get(frame))); - return Number + 1; - } - - protected override string ToStringRepresentation() => - $"RemoveFrom {_id} at {_index}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Return.cs b/Interpreter.Lib/BackEnd/Instructions/Return.cs deleted file mode 100644 index 0a9b3966..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Return.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections; -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class Return : Instruction, IEnumerable -{ - private readonly IValue _value; - private readonly List _callers = new(); - - public int FunctionStart { get; } - - public Return(int functionStart, int number, IValue value = null) : base(number) - { - _value = value; - FunctionStart = functionStart; - } - - public void AddCaller(int caller) => _callers.Add(caller); - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Pop(); - var call = vm.CallStack.Pop(); - if (call.Where != null && _value != null) - { - vm.Frames.Peek()[call.Where] = _value.Get(frame); - } - - return frame.ReturnAddress; - } - - public IEnumerator GetEnumerator() => _callers.GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - protected override string ToStringRepresentation() => $"Return{(_value != null ? $" {_value}" : "")}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/Instructions/Simple.cs b/Interpreter.Lib/BackEnd/Instructions/Simple.cs deleted file mode 100644 index 8ac1b483..00000000 --- a/Interpreter.Lib/BackEnd/Instructions/Simple.cs +++ /dev/null @@ -1,90 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.BackEnd.Instructions; - -public class Simple : Instruction -{ - public string Left { get; set; } - - protected (IValue left, IValue right) right; - protected readonly string @operator; - - public Simple( - string left, - (IValue left, IValue right) right, - string @operator, - int number - ) : - base(number) - { - Left = left; - this.right = right; - this.@operator = @operator; - } - - public IValue Source => right.right; - - public bool Assignment => @operator == ""; - - public override int Execute(VirtualMachine vm) - { - var frame = vm.Frames.Peek(); - if (right.left == null) - { - var value = right.right.Get(frame); - frame[Left] = @operator switch - { - "-" => -Convert.ToDouble(value), - "!" => !Convert.ToBoolean(value), - "~" => ((List) value).Count, - "" => value, - _ => throw new NotImplementedException() - }; - } - else - { - object lValue = right.left.Get(frame), rValue = right.right.Get(frame); - frame[Left] = @operator switch - { - "+" when lValue is string => lValue.ToString() + rValue, - "+" => Convert.ToDouble(lValue) + Convert.ToDouble(rValue), - "-" => Convert.ToDouble(lValue) - Convert.ToDouble(rValue), - "*" => Convert.ToDouble(lValue) * Convert.ToDouble(rValue), - "/" => Convert.ToDouble(lValue) / Convert.ToDouble(rValue), - "%" => Convert.ToDouble(lValue) % Convert.ToDouble(rValue), - "||" => Convert.ToBoolean(lValue) || Convert.ToBoolean(rValue), - "&&" => Convert.ToBoolean(lValue) && Convert.ToBoolean(rValue), - "==" => Equals(lValue, rValue), - "!=" => !Equals(lValue, rValue), - ">" => Convert.ToDouble(lValue) > Convert.ToDouble(rValue), - ">=" => Convert.ToDouble(lValue) >= Convert.ToDouble(rValue), - "<" => Convert.ToDouble(lValue) < Convert.ToDouble(rValue), - "<=" => Convert.ToDouble(lValue) <= Convert.ToDouble(rValue), - "." => ((Dictionary) lValue)[rValue.ToString()!], - "[]" => ((List) lValue)[Convert.ToInt32(rValue)], - "++" => ((List) lValue).Concat((List) rValue).ToList(), - _ => throw new NotImplementedException() - }; - } - if (vm.CallStack.Any()) - { - var call = vm.CallStack.Peek(); - var methodOf = call.To.MethodOf; - if (methodOf != null) - { - var methodOwner = (Dictionary) frame[methodOf]; - if (methodOwner.ContainsKey(Left)) - { - methodOwner[Left] = frame[Left]; - } - } - } - - return Jump(); - } - - protected override string ToStringRepresentation() => - right.left == null - ? $"{Left} = {@operator}{right.right}" - : $"{Left} = {right.left} {@operator} {right.right}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/BackEnd/VirtualMachine.cs b/Interpreter.Lib/BackEnd/VirtualMachine.cs deleted file mode 100644 index a88c5565..00000000 --- a/Interpreter.Lib/BackEnd/VirtualMachine.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.BackEnd; - -public record VirtualMachine( - Stack CallStack, Stack Frames, - Stack<(string Id, object Value)> Arguments, - TextWriter Writer -) -{ - public VirtualMachine() : - this(new(), new(), new(), Console.Out) { } - - public void Run(List instructions) - { - Frames.Push(new Frame()); - - var address = 0; - while (!instructions[address].End()) - { - var instruction = instructions[address]; - var jump = instruction.Execute(this); - address = jump; - } - - instructions[address].Execute(this); - } -} - -public record Call( - int From, FunctionInfo To, - List<(string Id, object Value)> Parameters, - string Where = null) -{ - public override string ToString() => - $"{From} => {To.Location}: {To.Id}({string.Join(", ", Parameters.Select(x => $"{x.Id}: {x.Value}"))})"; -} - -public record FunctionInfo(string Id, int Location = 0, string MethodOf = null) -{ - public int Location { get; set; } = Location; - - public string MethodOf { get; set; } = MethodOf; - - public string CallId() => - MethodOf == null - ? Id - : $"{MethodOf}.{Id}"; - - public override string ToString() => - $"({Location}, {CallId()})"; -} - -public class Frame -{ - private readonly Dictionary _variables = new(); - private readonly Frame _parentFrame; - - public int ReturnAddress { get; } - - public Frame(int returnAddress = 0, Frame parentFrame = null) - { - ReturnAddress = returnAddress; - _parentFrame = parentFrame; - } - - public object this[string id] - { - get => _variables.ContainsKey(id) - ? _variables[id] - : _parentFrame?[id]; - set => _variables[id] = value; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenTypeUtils.cs b/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenTypeUtils.cs deleted file mode 100644 index 8d2c6e6a..00000000 --- a/Interpreter.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenTypeUtils.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Interpreter.Lib.FrontEnd.GetTokens.Data.TokenTypes; - -public static class TokenTypeUtils -{ - public static readonly TokenType End = new EndOfProgramType(); - public static readonly TokenType Error = new ErrorType(); -} \ No newline at end of file diff --git a/Interpreter.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/Interpreter.Lib/FrontEnd/TopDownParse/Impl/Parser.cs deleted file mode 100644 index ef64c670..00000000 --- a/Interpreter.Lib/FrontEnd/TopDownParse/Impl/Parser.cs +++ /dev/null @@ -1,839 +0,0 @@ -using System.Text.RegularExpressions; -using Interpreter.Lib.FrontEnd.GetTokens; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.IR.Ast; -using Interpreter.Lib.IR.Ast.Impl; -using Interpreter.Lib.IR.Ast.Nodes; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.ComplexLiterals; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Statements; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; -using Expression = Interpreter.Lib.IR.Ast.Nodes.Expressions.Expression; - -namespace Interpreter.Lib.FrontEnd.TopDownParse.Impl; - -public class Parser : IParser -{ - private TokensStream _tokens; - private readonly ILexer _lexer; - - public Parser(ILexer lexer) => - _lexer = lexer; - - private Token Expect(string expectedTag, string expectedValue = null) - { - var current = _tokens.Current; - - if (!CurrentIs(expectedTag)) - throw new ParserException(_tokens.Current!.Segment, expectedTag, _tokens.Current); - if (_tokens.Current!.Value != (expectedValue ?? _tokens.Current.Value)) - throw new ParserException(_tokens.Current.Segment, expectedValue, _tokens.Current); - - if (CurrentIs(expectedTag) && _tokens.Current.Value == (expectedValue ?? _tokens.Current.Value)) - { - _tokens.MoveNext(); - } - - return current; - } - - private bool CurrentIs(string tag) => - _tokens.Current!.Type == _lexer.Structure.FindByTag(tag); - - private bool CurrentIsLiteral() => - CurrentIs("NullLiteral") || - CurrentIs("IntegerLiteral") || - CurrentIs("FloatLiteral") || - CurrentIs("StringLiteral") || - CurrentIs("BooleanLiteral"); - - private bool CurrentIsKeyword(string keyword) => - CurrentIs("Keyword") && - _tokens.Current!.Value == keyword; - - private bool CurrentIsOperator(string @operator) => - CurrentIs("Operator") && - _tokens.Current!.Value == @operator; - - public IAbstractSyntaxTree TopDownParse(string text) - { - _tokens = _lexer.GetTokens(text); - - var root = Script(SymbolTableUtils.GetStandardLibrary()); - Expect("EOP"); - return new AbstractSyntaxTree(root); - } - - private ScriptBody Script(SymbolTable table = null) => - new(StatementList(table ?? new SymbolTable())) - { - SymbolTable = table ?? new SymbolTable() - }; - - private IEnumerable StatementList(SymbolTable table) - { - var statementList = new List(); - while ( - CurrentIsKeyword("function") || CurrentIsKeyword("let") || CurrentIsKeyword("const") || - CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || - CurrentIs("LeftCurl") || CurrentIsKeyword("return") || CurrentIsKeyword("break") || - CurrentIsKeyword("continue") || CurrentIsKeyword("if") || CurrentIsKeyword("while") || - CurrentIsKeyword("type") - ) - { - statementList.Add(StatementListItem(table)); - } - - return statementList; - } - - private StatementListItem StatementListItem(SymbolTable table) - { - if (CurrentIsKeyword("function") || CurrentIsKeyword("let") || CurrentIsKeyword("const")) - { - return Declaration(table); - } - - return Statement(table); - } - - private Statement Statement(SymbolTable table) - { - if (CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || CurrentIsOperator("-") || - CurrentIsOperator("!")) - { - return ExpressionStatement(table); - } - - if (CurrentIs("LeftCurl")) - { - return BlockStatement(table); - } - - if (CurrentIsKeyword("return")) - { - return ReturnStatement(table); - } - - if (CurrentIsKeyword("break")) - { - return new BreakStatement - { - Segment = Expect("Keyword", "break").Segment - }; - } - - if (CurrentIsKeyword("continue")) - { - return new ContinueStatement - { - Segment = Expect("Keyword", "continue").Segment - }; - } - - if (CurrentIsKeyword("if")) - { - return IfStatement(table); - } - - if (CurrentIsKeyword("while")) - { - return WhileStatement(table); - } - - if (CurrentIsKeyword("type")) - { - return TypeStatement(table); - } - - return null; - } - - private BlockStatement BlockStatement(SymbolTable table) - { - var newTable = new SymbolTable(); - newTable.AddOpenScope(table); - - Expect("LeftCurl"); - var block = new BlockStatement(StatementList(newTable)) - { - SymbolTable = newTable - }; - Expect("RightCurl"); - - return block; - } - - private ExpressionStatement ExpressionStatement(SymbolTable table) - { - return new(Expression(table)); - } - - private ReturnStatement ReturnStatement(SymbolTable table) - { - var ret = Expect("Keyword", "return"); - if (CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || CurrentIsOperator("-") || - CurrentIsOperator("!") || CurrentIs("LeftCurl") || CurrentIs("LeftBracket")) - { - return new ReturnStatement(Expression(table)) - { - Segment = ret.Segment, - SymbolTable = table - }; - } - - return new ReturnStatement - { - Segment = ret.Segment - }; - } - - private IfStatement IfStatement(SymbolTable table) - { - var token = Expect("Keyword", "if"); - Expect("LeftParen"); - var expr = Expression(table); - Expect("RightParen"); - var then = Statement(table); - if (CurrentIsKeyword("else")) - { - Expect("Keyword", "else"); - var @else = Statement(table); - return new IfStatement(expr, then, @else) {SymbolTable = table, Segment = token.Segment}; - } - - return new IfStatement(expr, then) {SymbolTable = table, Segment = token.Segment}; - } - - private WhileStatement WhileStatement(SymbolTable table) - { - var token = Expect("Keyword", "while"); - Expect("LeftParen"); - var expr = Expression(table); - Expect("RightParen"); - var stmt = Statement(table); - return new WhileStatement(expr, stmt) {SymbolTable = table, Segment = token.Segment}; - } - - private TypeStatement TypeStatement(SymbolTable table) - { - var typeWord = Expect("Keyword", "type"); - var ident = Expect("Ident"); - Expect("Assign"); - if (CurrentIs("LeftCurl")) - { - table.AddType(new Type(ident.Value)); - } - var type = TypeValue(table); - - type.Recursive = type.ToString().Contains(ident.Value); - - if (type is ObjectType objectType && type.Recursive) - { - objectType.ResolveSelfReferences(ident.Value); - } - table.AddType(type, ident.Value); - - return new TypeStatement(ident.Value, type) - { - Segment = typeWord.Segment, - SymbolTable = table - }; - } - - private Type TypeValue(SymbolTable table) - { - if (CurrentIs("Ident")) - { - var ident = Expect("Ident"); - var typeFromTable = table.FindType(ident.Value); - if (typeFromTable == null) - { - throw new UnknownIdentifierReference( - new IdentifierReference(ident.Value) - {Segment = ident.Segment} - ); - } - - return WithSuffix(typeFromTable); - } - - if (CurrentIs("LeftCurl")) - { - Expect("LeftCurl"); - var propertyTypes = new List(); - while (CurrentIs("Ident")) - { - var ident = Expect("Ident"); - Expect("Colon"); - var propType = TypeValue(table); - propertyTypes.Add(new PropertyType(ident.Value, propType)); - Expect("SemiColon"); - } - - Expect("RightCurl"); - - return WithSuffix(new ObjectType(propertyTypes)); - } - - if (CurrentIs("LeftParen")) - { - Expect("LeftParen"); - var args = new List(); - while (CurrentIs("Ident") || CurrentIs("LeftCurl") || CurrentIs("LeftParen")) - { - args.Add(TypeValue(table)); - if (!CurrentIs("RightParen")) - { - Expect("Comma"); - } - } - Expect("RightParen"); - Expect("Arrow"); - var returnType = TypeValue(table); - return new FunctionType(returnType, args); - } - - return null; - } - - private Type WithSuffix(Type baseType) - { - var type = baseType; - while (CurrentIs("LeftBracket") || CurrentIs("QuestionMark")) - { - if (CurrentIs("LeftBracket")) - { - Expect("LeftBracket"); - Expect("RightBracket"); - type = new ArrayType(type); - } - else if (CurrentIs("QuestionMark")) - { - Expect("QuestionMark"); - type = new NullableType(type); - } - } - - return type; - } - - private Declaration Declaration(SymbolTable table) - { - if (CurrentIsKeyword("function")) - { - return FunctionDeclaration(table); - } - - if (CurrentIsKeyword("let") || CurrentIsKeyword("const")) - { - return LexicalDeclaration(table); - } - - return null; - } - - private FunctionDeclaration FunctionDeclaration(SymbolTable table) - { - var newTable = new SymbolTable(); - newTable.AddOpenScope(table); - - Expect("Keyword", "function"); - var ident = Expect("Ident"); - - Expect("LeftParen"); - var args = new List(); - if (CurrentIs("Ident")) - { - var arg = Expect("Ident").Value; - Expect("Colon"); - var type = TypeValue(table); - args.Add(new VariableSymbol(arg, type)); - } - - while (CurrentIs("Comma")) - { - Expect("Comma"); - var arg = Expect("Ident").Value; - Expect("Colon"); - var type = TypeValue(table); - args.Add(new VariableSymbol(arg, type)); - } - - Expect("RightParen"); - - var returnType = TypeUtils.JavaScriptTypes.Void; - if (CurrentIs("Colon")) - { - Expect("Colon"); - returnType = TypeValue(table); - } - - var functionSymbol = - new FunctionSymbol(ident.Value, args, - new FunctionType(returnType, args.Select(x => x.Type)) - ); - table.AddSymbol(functionSymbol); - - return new FunctionDeclaration(functionSymbol, BlockStatement(newTable)) - { - Segment = ident.Segment, - SymbolTable = newTable - }; - } - - private LexicalDeclaration LexicalDeclaration(SymbolTable table) - { - var readOnly = CurrentIsKeyword("const"); - Expect("Keyword", readOnly ? "const" : "let"); - var declaration = new LexicalDeclaration(readOnly) - { - SymbolTable = table - }; - - AddToDeclaration(declaration, table); - - while (CurrentIs("Comma")) - { - Expect("Comma"); - AddToDeclaration(declaration, table); - } - - return declaration; - } - - private void AddToDeclaration(LexicalDeclaration declaration, SymbolTable table) - { - var ident = Expect("Ident"); - if (CurrentIs("Assign")) - { - var assignSegment = Expect("Assign").Segment; - declaration.AddAssignment(ident.Value, ident.Segment, Expression(table), assignSegment); - } - else if (CurrentIs("Colon")) - { - Expect("Colon"); - var type = TypeValue(table); - if (CurrentIs("Assign")) - { - var assignSegment = Expect("Assign").Segment; - declaration.AddAssignment(ident.Value, ident.Segment, Expression(table), assignSegment, type); - } - else - { - declaration.AddAssignment( - ident.Value, - ident.Segment, - new Literal( - type, - TypeUtils.GetDefaultValue(type), - label: TypeUtils.GetDefaultValue(type) == null ? "null" : null - ) - ); - } - } - } - - private Expression Expression(SymbolTable table) - { - return AssignmentExpression(table); - } - - private Expression AssignmentExpression(SymbolTable table) - { - var lhs = LeftHandSideExpression(table); - if (CurrentIs("Assign") && !(lhs is CallExpression)) - { - var assign = Expect("Assign"); - var member = lhs is IdentifierReference reference - ? (MemberExpression) reference - : (MemberExpression) lhs; - return new AssignmentExpression(member, AssignmentExpression(table)) - {SymbolTable = table, Segment = assign.Segment}; - } - - return lhs; - } - - private Expression LeftHandSideExpression(SymbolTable table) - { - var expr = CastExpression(table); - if (expr is IdentifierReference identRef) - { - if (CurrentIs("LeftParen") || CurrentIs("LeftBracket") || CurrentIs("Dot")) - { - return CallExpression(identRef, table); - } - } - - return expr; - } - - private Expression CallExpression(IdentifierReference identRef, SymbolTable table) - { - var member = MemberExpression(identRef, table); - if (CurrentIs("LeftParen")) - { - var lp = Expect("LeftParen"); - var expressions = new List(); - if (CurrentIs("Ident") || CurrentIsLiteral() || CurrentIs("LeftParen") || CurrentIsOperator("-")) - { - expressions.Add(Expression(table)); - } - - while (CurrentIs("Comma")) - { - Expect("Comma"); - expressions.Add(Expression(table)); - } - - Expect("RightParen"); - return new CallExpression(member, expressions) - { - SymbolTable = table, - Segment = lp.Segment - }; - } - - return member; - } - - private MemberExpression MemberExpression(IdentifierReference identRef, SymbolTable table) - { - var accessChain = new List(); - while (CurrentIs("LeftBracket") || CurrentIs("Dot")) - { - Token access; - if (CurrentIs("LeftBracket")) - { - access = Expect("LeftBracket"); - var lb = access.Segment; - var expr = Expression(table); - var rb = Expect("RightBracket").Segment; - accessChain.Add( - new IndexAccess(expr, accessChain.LastOrDefault()) {Segment = lb + rb} - ); - } - else if (CurrentIs("Dot")) - { - access = Expect("Dot"); - var identToken = Expect("Ident"); - var idRef = new IdentifierReference(identToken.Value) - { - Segment = identToken.Segment, - SymbolTable = table - }; - accessChain.Add( - new DotAccess(idRef, accessChain.LastOrDefault()) {Segment = access.Segment} - ); - } - } - - return new MemberExpression(identRef, accessChain.FirstOrDefault()) - { - SymbolTable = table - }; - } - - private Expression CastExpression(SymbolTable table) - { - var cond = ConditionalExpression(table); - if (CurrentIsKeyword("as")) - { - var asKeyword = Expect("Keyword", "as"); - var type = TypeValue(table); - return new CastAsExpression(cond, type) {Segment = asKeyword.Segment}; - } - - return cond; - } - - private Expression ConditionalExpression(SymbolTable table) - { - var test = OrExpression(table); - if (CurrentIs("QuestionMark")) - { - Expect("QuestionMark"); - var consequent = AssignmentExpression(table); - Expect("Colon"); - var alternate = AssignmentExpression(table); - return new ConditionalExpression(test, consequent, alternate); - } - - return test; - } - - private Expression OrExpression(SymbolTable table) - { - var left = AndExpression(table); - while (CurrentIsOperator("||")) - { - var op = Expect("Operator"); - var right = AndExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression AndExpression(SymbolTable table) - { - var left = EqualityExpression(table); - while (CurrentIsOperator("&&")) - { - var op = Expect("Operator"); - var right = EqualityExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression EqualityExpression(SymbolTable table) - { - var left = RelationExpression(table); - while (CurrentIsOperator("==") || CurrentIsOperator("!=")) - { - var op = Expect("Operator"); - var right = RelationExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression RelationExpression(SymbolTable table) - { - var left = AdditiveExpression(table); - while (CurrentIsOperator(">") || CurrentIsOperator("<") || CurrentIsOperator(">=") || - CurrentIsOperator("<=")) - { - var op = Expect("Operator"); - var right = AdditiveExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression AdditiveExpression(SymbolTable table) - { - var left = MultiplicativeExpression(table); - while (CurrentIsOperator("+") || CurrentIsOperator("-")) - { - var op = Expect("Operator"); - var right = MultiplicativeExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression MultiplicativeExpression(SymbolTable table) - { - var left = UnaryExpression(table); - while (CurrentIsOperator("*") || CurrentIsOperator("/") || CurrentIsOperator("%") - || CurrentIsOperator("++") || CurrentIsOperator("::")) - { - var op = Expect("Operator"); - var right = UnaryExpression(table); - left = new BinaryExpression(left, op.Value, right) - { - Segment = op.Segment - }; - } - - return left; - } - - private Expression UnaryExpression(SymbolTable table) - { - if (CurrentIsOperator("-") || CurrentIsOperator("!") || CurrentIsOperator("~")) - { - var op = Expect("Operator"); - return new UnaryExpression(op.Value, UnaryExpression(table)) - { - Segment = op.Segment - }; - } - - return PrimaryExpression(table); - } - - private Expression PrimaryExpression(SymbolTable table) - { - if (CurrentIs("LeftParen")) - { - Expect("LeftParen"); - var expr = Expression(table); - Expect("RightParen"); - return expr; - } - - if (CurrentIs("Ident")) - { - var ident = Expect("Ident"); - var id = new IdentifierReference(ident.Value) - { - Segment = ident.Segment, - SymbolTable = table - }; - - return id; - } - - if (CurrentIsLiteral()) - { - return Literal(); - } - - if (CurrentIs("LeftCurl")) - { - return ObjectLiteral(table); - } - - if (CurrentIs("LeftBracket")) - { - return ArrayLiteral(table); - } - - return null; - } - - private Literal Literal() - { - var segment = _tokens.Current!.Segment; - if (CurrentIs("StringLiteral")) - { - var str = Expect("StringLiteral"); - return new Literal( - TypeUtils.JavaScriptTypes.String, - Regex.Unescape(str.Value.Trim('"')), - segment, - str.Value - .Replace(@"\", @"\\") - .Replace(@"""", @"\""") - ); - } - - return _tokens.Current.Type.Tag switch - { - "NullLiteral" => new Literal(TypeUtils.JavaScriptTypes.Null, - Expect("NullLiteral").Value == "null" ? null : "", segment, "null"), - "IntegerLiteral" => new Literal(TypeUtils.JavaScriptTypes.Number, - double.Parse(Expect("IntegerLiteral").Value), segment), - "FloatLiteral" => new Literal(TypeUtils.JavaScriptTypes.Number, - double.Parse(Expect("FloatLiteral").Value), segment), - "BooleanLiteral" => new Literal(TypeUtils.JavaScriptTypes.Boolean, - bool.Parse(Expect("BooleanLiteral").Value), segment), - _ => new Literal(TypeUtils.JavaScriptTypes.Undefined, new TypeUtils.Undefined()) - }; - } - - private ObjectLiteral ObjectLiteral(SymbolTable table) - { - var newTable = new SymbolTable(); - newTable.AddOpenScope(table); - Expect("LeftCurl"); - var properties = new List(); - var methods = new List(); - while (CurrentIs("Ident")) - { - var idToken = Expect("Ident"); - var id = new IdentifierReference(idToken.Value) - { - Segment = idToken.Segment, - SymbolTable = newTable - }; - if (CurrentIs("Colon")) - { - Expect("Colon"); - var expr = Expression(newTable); - properties.Add(new Property(id, expr)); - } - else if (CurrentIs("Arrow")) - { - Expect("Arrow"); - Expect("LeftParen"); - var args = new List(); - while (CurrentIs("Ident")) - { - var name = Expect("Ident").Value; - Expect("Colon"); - var type = TypeValue(newTable); - args.Add(new VariableSymbol(name, type)); - if (!CurrentIs("RightParen")) - { - Expect("Comma"); - } - } - Expect("RightParen"); - var returnType = TypeUtils.JavaScriptTypes.Void; - if (CurrentIs("Colon")) - { - Expect("Colon"); - returnType = TypeValue(newTable); - } - - var functionSymbol = new FunctionSymbol(idToken.Value, args, - new FunctionType(returnType, args.Select(a => a.Type)) - ); - newTable.AddSymbol(functionSymbol); - var bodyTable = new SymbolTable(); - bodyTable.AddOpenScope(newTable); - methods.Add(new FunctionDeclaration(functionSymbol, BlockStatement(bodyTable)) - { - Segment = idToken.Segment, - SymbolTable = bodyTable - }); - } - - Expect("SemiColon"); - } - Expect("RightCurl"); - return new ObjectLiteral(properties, methods) - { - SymbolTable = newTable - }; - } - - private ArrayLiteral ArrayLiteral(SymbolTable table) - { - var lb = Expect("LeftBracket").Segment; - var expressions = new List(); - while (CurrentIs("Ident") || CurrentIsLiteral() || - CurrentIs("LeftParen") || CurrentIsOperator("-") || - CurrentIsOperator("!") || CurrentIs("LeftCurl") || - CurrentIs("LeftBracket")) - { - expressions.Add(Expression(table)); - if (!CurrentIs("RightBracket")) - { - Expect("Comma"); - } - } - var rb = Expect("RightBracket").Segment; - return new ArrayLiteral(expressions) {Segment = lb + rb}; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/GlobalUsings.cs b/Interpreter.Lib/GlobalUsings.cs deleted file mode 100644 index ab06ac66..00000000 --- a/Interpreter.Lib/GlobalUsings.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Global using directives - -global using Type = Interpreter.Lib.IR.CheckSemantics.Types.Type; \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/IAbstractSyntaxTree.cs b/Interpreter.Lib/IR/Ast/IAbstractSyntaxTree.cs deleted file mode 100644 index 15e5f494..00000000 --- a/Interpreter.Lib/IR/Ast/IAbstractSyntaxTree.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.IR.Ast; - -public interface IAbstractSyntaxTree -{ - List GetInstructions(); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/Interpreter.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs deleted file mode 100644 index a04f5e1b..00000000 --- a/Interpreter.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Text; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast.Nodes; - -namespace Interpreter.Lib.IR.Ast.Impl; - -public class AbstractSyntaxTree : IAbstractSyntaxTree -{ - private readonly AbstractSyntaxTreeNode _root; - - public AbstractSyntaxTree(AbstractSyntaxTreeNode root) - { - _root = root; - } - - private void Check() => - GetAllNodes().ToList().ForEach(node => node.SemanticCheck()); - - private IEnumerable GetAllNodes() => - _root.GetAllNodes(); - - public List GetInstructions() - { - Check(); - - var start = 0; - var result = new List(); - foreach (var node in _root) - { - var instructions = node.ToInstructions(start); - result.AddRange(instructions); - start += instructions.Count; - } - - result.Sort(); - result.Add(new Halt(result.Count)); - - var calls = result.OfType().GroupBy(i => i.Jump()); - foreach (var call in calls) - { - var returns = result.OfType() - .Where(r => r.FunctionStart == call.Key); - foreach (var ret in returns) - { - foreach (var caller in call) - { - ret.AddCaller(caller.Number + 1); - } - } - } - return result; - } - - public override string ToString() - { - var tree = new StringBuilder("digraph ast {\n"); - _root.GetAllNodes().ForEach(node => - { - tree.Append('\t').Append(node).Append('\n'); - node.ToList().ForEach(child => tree.Append($"\t{node.GetHashCode()}->{child.GetHashCode()}\n")); - }); - return tree.Append("}\n").ToString(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/AbstractSyntaxTreeNode.cs b/Interpreter.Lib/IR/Ast/Nodes/AbstractSyntaxTreeNode.cs deleted file mode 100644 index 0c241ad1..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/AbstractSyntaxTreeNode.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Collections; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.CheckSemantics.Variables; - -namespace Interpreter.Lib.IR.Ast.Nodes; - -public abstract class AbstractSyntaxTreeNode : IEnumerable -{ - public AbstractSyntaxTreeNode Parent { get; set; } - - public SymbolTable SymbolTable { get; set; } - - public bool CanEvaluate { get; protected init; } - - public Segment Segment { get; init; } - - protected AbstractSyntaxTreeNode() - { - Parent = null; - CanEvaluate = false; - } - - internal List GetAllNodes() - { - var result = new List - { - this - }; - foreach (var child in this) - { - result.AddRange(child.GetAllNodes()); - } - - return result; - } - - public bool ChildOf() where T : AbstractSyntaxTreeNode - { - var parent = Parent; - while (parent != null) - { - if (parent is T) - { - return true; - } - parent = parent.Parent; - } - - return false; - } - - public void SemanticCheck() - { - if (CanEvaluate && !ChildOf()) - { - NodeCheck(); - } - } - - internal virtual Type NodeCheck() => null; - - public virtual List ToInstructions(int start) => new (); - - public abstract IEnumerator GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - protected abstract string NodeRepresentation(); - - public override string ToString() => $"{GetHashCode()} [label=\"{NodeRepresentation()}\"]"; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Declarations/Declaration.cs b/Interpreter.Lib/IR/Ast/Nodes/Declarations/Declaration.cs deleted file mode 100644 index 426a64fb..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Declarations/Declaration.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes.Declarations; - -public abstract class Declaration : StatementListItem -{ - public override bool IsDeclaration() => true; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Declarations/FunctionDeclaration.cs b/Interpreter.Lib/IR/Ast/Nodes/Declarations/FunctionDeclaration.cs deleted file mode 100644 index 7d578fde..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Declarations/FunctionDeclaration.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Statements; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Declarations; - -public class FunctionDeclaration : Declaration -{ - private readonly FunctionSymbol _function; - - private readonly BlockStatement _statements; - - public FunctionDeclaration(FunctionSymbol function, BlockStatement statements) - { - _function = function; - function.Body = this; - - _statements = statements; - _statements.Parent = this; - } - - public bool HasReturnStatement() => _statements.HasReturnStatement(); - - public void SetArguments(CallExpression call, List expressions) - { - if (_function.Type.Arguments.Count == expressions.Count) - { - expressions.Select((e, i) => (e, i)).ToList() - .ForEach(pair => - { - var (e, i) = pair; - var eType = e.NodeCheck(); - if (_function.Type.Arguments[i].Equals(eType)) - { - SymbolTable.AddSymbol(_function.Parameters[i]); - } - else throw new WrongTypeOfArgument(e.Segment, _function.Type.Arguments[i], eType); - }); - } - else throw new WrongNumberOfArguments(call.Segment, _function.Parameters.Count, expressions.Count); - } - - public void Clear() - { - _statements.GetAllNodes().ForEach(x => x.SymbolTable?.Clear()); - SymbolTable.Clear(); - } - - public FunctionSymbol GetSymbol() => _function; - - public override IEnumerator GetEnumerator() - { - yield return _statements; - } - - protected override string NodeRepresentation() => $"function {_function.Id}"; - - public override List ToInstructions(int start) - { - var instructions = new List(); - if (_statements.Any()) - { - _function.CallInfo.Location = start + 1; - - var body = new List - { - new BeginFunction(_function.CallInfo.Location, _function.CallInfo) - }; - body.AddRange(_statements.ToInstructions(_function.CallInfo.Location + 1)); - if (!_statements.HasReturnStatement()) - { - body.Add(new Return(_function.CallInfo.Location, body.Last().Number + 1)); - } - - instructions.Add(new Goto(body.Last().Number + 1, start)); - - instructions.AddRange(body); - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Declarations/LexicalDeclaration.cs b/Interpreter.Lib/IR/Ast/Nodes/Declarations/LexicalDeclaration.cs deleted file mode 100644 index 056519e4..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Declarations/LexicalDeclaration.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Declarations; - -public class LexicalDeclaration : Declaration -{ - private readonly DeclarationType _declarationType; - private readonly List _assignments = new(); - - public LexicalDeclaration(bool readOnly) - { - _declarationType = readOnly ? DeclarationType.Const : DeclarationType.Let; - } - - public void AddAssignment(string id, Segment identSegment, Expression expression, Segment assignSegment = null, Type destinationType = null) - { - var identRef = new IdentifierReference(id) - { - SymbolTable = SymbolTable, - Segment = identSegment - }; - var assignment = - new AssignmentExpression( - new MemberExpression(identRef, null), - expression, - destinationType - ) - { - SymbolTable = SymbolTable, - Segment = assignSegment, - Parent = this - }; - _assignments.Add(assignment); - } - - public bool Const() => _declarationType == DeclarationType.Const; - - public override IEnumerator GetEnumerator() => _assignments.GetEnumerator(); - - protected override string NodeRepresentation() => _declarationType.ToString(); - - public override List ToInstructions(int start) - { - var instructions = new List(); - var offset = start; - foreach (var aInstructions in _assignments.Select(assignment => assignment.ToInstructions(offset))) - { - instructions.AddRange(aInstructions); - offset += aInstructions.Count; - } - - return instructions; - } - - private enum DeclarationType - { - Let, - Const - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs deleted file mode 100644 index 9ffd5e11..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; - -public abstract class AccessExpression : Expression -{ - public AccessExpression Next { get; private set; } - - protected AccessExpression(AccessExpression prev) - { - if (prev != null) - { - Parent = prev; - prev.Next = this; - } - } - - public AccessExpression Tail - { - get - { - var head = this; - while (head.HasNext()) - { - head = head.Next; - } - - return head; - } - } - - public abstract Type Check(Type prev); - - public bool HasNext() => Next != null; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs deleted file mode 100644 index b2ea92b8..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; - -public class DotAccess : AccessExpression -{ - private readonly IdentifierReference _id; - - public DotAccess(IdentifierReference id, AccessExpression prev = null) : base(prev) - { - _id = id; - _id.Parent = this; - } - - public string Id => _id.Id; - - public override Type Check(Type prev) - { - if (prev is ObjectType objectType) - { - var fieldType = objectType[_id.Id]; - if (fieldType != null) - { - return HasNext() ? Next.Check(fieldType) : fieldType; - } - - throw new ObjectAccessException(Segment, objectType, _id.Id); - } - - return null; - } - - public override IEnumerator GetEnumerator() - { - yield return _id; - if (HasNext()) - { - yield return Next; - } - } - - protected override string NodeRepresentation() => "."; - - public override List ToInstructions(int start, string temp) - { - if (HasNext()) - { - var left = "_t" + start; - var nextInstructions = Next.ToInstructions(start + 1, left); - nextInstructions.Insert(0, - new Simple(left, (new Name(temp), new Constant(_id.Id, _id.Id)), ".", start) - ); - return nextInstructions; - } - - return new(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs deleted file mode 100644 index f733a7a1..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ /dev/null @@ -1,68 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; - -public class IndexAccess : AccessExpression -{ - private readonly Expression _expression; - - public IndexAccess(Expression expression, AccessExpression prev = null) : base(prev) - { - _expression = expression; - _expression.Parent = this; - } - - public PrimaryExpression Expression => _expression as PrimaryExpression; - - public override IEnumerator GetEnumerator() - { - yield return _expression; - if (HasNext()) - { - yield return Next; - } - } - - public override Type Check(Type prev) - { - if (prev is ArrayType arrayType) - { - var indexType = _expression.NodeCheck(); - if (indexType.Equals(TypeUtils.JavaScriptTypes.Number)) - { - var elemType = arrayType.Type; - return HasNext() ? Next.Check(elemType) : elemType; - } - - throw new ArrayAccessException(Segment, indexType); - } - - return null; - } - - protected override string NodeRepresentation() => "[]"; - - public override List ToInstructions(int start, string temp) - { - if (HasNext()) - { - if (_expression is PrimaryExpression prim) - { - var left = "_t" + start; - var nextInstructions = Next.ToInstructions(start + 1, left); - nextInstructions.Insert(0, - new Simple(left, (new Name(temp), prim.ToValue()), "[]", start) - ); - return nextInstructions; - } - - throw new NotImplementedException(); - } - - return new(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AssignmentExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/AssignmentExpression.cs deleted file mode 100644 index b98f1299..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/AssignmentExpression.cs +++ /dev/null @@ -1,183 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class AssignmentExpression : Expression -{ - private readonly MemberExpression _destination; - private readonly Expression _source; - private readonly Type _destinationType; - - public AssignmentExpression(MemberExpression destination, Expression source, Type destinationType = null) - { - _destination = destination; - destination.Parent = this; - - _source = source; - source.Parent = this; - - _destinationType = destinationType; - } - - internal override Type NodeCheck() - { - var id = _destination.Id; - var type = _source.NodeCheck(); - if (Parent is LexicalDeclaration declaration) - { - if (declaration.Const() && type.Equals(TypeUtils.JavaScriptTypes.Undefined)) - { - throw new ConstWithoutInitializer(_destination); - } - - if (SymbolTable.ContainsSymbol(_destination.Id)) - { - throw new DeclarationAlreadyExists(_destination); - } - - if (_destinationType != null && type.Equals(TypeUtils.JavaScriptTypes.Undefined)) - { - type = _destinationType; - } - - if (_destinationType != null && !_destinationType.Equals(type)) - { - throw new IncompatibleTypesOfOperands(Segment, _destinationType, type); - } - - if (_destinationType == null && type.Equals(TypeUtils.JavaScriptTypes.Undefined)) - { - throw new CannotDefineType(Segment); - } - - var typeOfSymbol = _destinationType != null && type.Equals(TypeUtils.JavaScriptTypes.Undefined) - ? _destinationType - : type; - if (typeOfSymbol is ObjectType objectTypeOfSymbol) - { - SymbolTable.AddSymbol(new ObjectSymbol(id, objectTypeOfSymbol, declaration.Const(), _source.SymbolTable) - { - Table = _source.SymbolTable - }); - } - else - { - SymbolTable.AddSymbol(new VariableSymbol(id, typeOfSymbol, declaration.Const())); - } - } - else - { - var symbol = SymbolTable.FindSymbol(id); - if (symbol != null) - { - if (symbol.ReadOnly) - { - throw new AssignmentToConst(_destination); - } - - if (!_destination.NodeCheck().Equals(type)) - { - throw new IncompatibleTypesOfOperands(Segment, symbol.Type, type); - } - } - } - - return type; - } - - public override List ToInstructions(int start) - { - var instructions = new List(); - var destInstructions = _destination.ToInstructions(start, _destination.Id); - var srcInstructions = _source.ToInstructions(start + destInstructions.Count, _destination.Id); - - instructions.AddRange(destInstructions); - instructions.AddRange(srcInstructions); - start += instructions.Count; - - if (_source is MemberExpression member && member.Any()) - { - var access = (member.First() as AccessExpression)?.Tail; - var dest = destInstructions.Any() - ? destInstructions.OfType().Last().Left - : _destination.Id; - var src = srcInstructions.Any() - ? srcInstructions.OfType().Last().Left - : member.Id; - var instruction = access switch - { - DotAccess dot => new Simple(dest, (new Name(src), new Constant(dot.Id, dot.Id)), ".", start), - IndexAccess index => new Simple(dest, (new Name(src), index.Expression.ToValue()), "[]", start), - _ => throw new NotImplementedException() - }; - instructions.Add(instruction); - start++; - } - - var last = instructions.OfType().LastOrDefault(); - if (last != null) - { - if (_source is AssignmentExpression) - { - instructions.Add(new Simple( - _destination.Id, - (null, new Name(last.Left)), - "", last.Jump() - )); - start++; - } - else - { - last.Left = _destination.Id; - } - } - - if (_destination.Any()) - { - var access = (_destination.First() as AccessExpression)?.Tail; - var lastIndex = instructions.Count - 1; - last = instructions.OfType().Last(); - if (last.Assignment) - { - instructions.RemoveAt(lastIndex); - start--; - } - else - { - last.Left = "_t" + last.Number; - } - - var dest = destInstructions.Any() - ? destInstructions.OfType().Last().Left - : _destination.Id; - var src = !last.Assignment - ? new Name(last.Left) - : last.Source; - Instruction instruction = access switch - { - DotAccess dot => new DotAssignment(dest, (new Constant(dot.Id, @$"\""{dot.Id}\"""), src), start), - IndexAccess index => new IndexAssignment(dest, (index.Expression.ToValue(), src), start), - _ => throw new NotImplementedException() - }; - instructions.Add(instruction); - } - - return instructions; - } - - public override IEnumerator GetEnumerator() - { - yield return _destination; - yield return _source; - } - - protected override string NodeRepresentation() => "="; - - public override List ToInstructions(int start, string temp) => ToInstructions(start); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/BinaryExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/BinaryExpression.cs deleted file mode 100644 index 3d3963ea..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/BinaryExpression.cs +++ /dev/null @@ -1,209 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class BinaryExpression : Expression -{ - private readonly Expression _left; - - private readonly string _operator; - - private readonly Expression _right; - - public BinaryExpression(Expression left, string @operator, Expression right) - { - _left = left; - _left.Parent = this; - - _operator = @operator; - - _right = right; - _right.Parent = this; - } - - internal override Type NodeCheck() - { - var lType = _left.NodeCheck(); - var rType = _right.NodeCheck(); - Type retType = null; - if (_operator != "::" && !lType.Equals(rType)) - { - throw new IncompatibleTypesOfOperands(Segment, lType, rType); - } - - switch (_operator) - { - case "+": - if (lType.Equals(TypeUtils.JavaScriptTypes.Number)) - { - retType = TypeUtils.JavaScriptTypes.Number; - } - else if (lType.Equals(TypeUtils.JavaScriptTypes.String)) - { - retType = TypeUtils.JavaScriptTypes.String; - } - else throw new UnsupportedOperation(Segment, lType, _operator); - - break; - case "-": - case "*": - case "/": - case "%": - if (lType.Equals(TypeUtils.JavaScriptTypes.Number)) - { - retType = TypeUtils.JavaScriptTypes.Number; - } - else throw new UnsupportedOperation(Segment, lType, _operator); - - break; - case "||": - case "&&": - if (lType.Equals(TypeUtils.JavaScriptTypes.Boolean)) - { - retType = TypeUtils.JavaScriptTypes.Boolean; - } - else throw new UnsupportedOperation(Segment, lType, _operator); - - break; - case "==": - case "!=": - retType = TypeUtils.JavaScriptTypes.Boolean; - break; - case ">": - case ">=": - case "<": - case "<=": - if (lType.Equals(TypeUtils.JavaScriptTypes.Number)) - { - retType = TypeUtils.JavaScriptTypes.Boolean; - } - else throw new UnsupportedOperation(Segment, lType, _operator); - - break; - case "++": - if (lType is ArrayType && rType is ArrayType) - { - retType = lType; - } - else throw new UnsupportedOperation(Segment, lType, _operator); - - break; - case "::": - if (!(lType is ArrayType)) - { - throw new UnsupportedOperation(Segment, lType, _operator); - } - if (rType.Equals(TypeUtils.JavaScriptTypes.Number)) - { - retType = TypeUtils.JavaScriptTypes.Void; - } - else throw new ArrayAccessException(Segment, rType); - - break; - } - - return retType; - } - - public override IEnumerator GetEnumerator() - { - yield return _left; - yield return _right; - } - - protected override string NodeRepresentation() => _operator; - - public override List ToInstructions(int start) - { - if (_left is IdentifierReference arr && _right.Primary() && _operator == "::") - { - return new List - { - new RemoveFromArray(start, arr.Id, ((PrimaryExpression) _right).ToValue()) - }; - } - - throw new NotImplementedException(); - } - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - (IValue left, IValue right) newRight = (null, null); - - var lInstructions = new List(); - var rInstructions = new List(); - - if (_left.Primary()) - { - newRight.left = ((PrimaryExpression) _left).ToValue(); - } - else - { - lInstructions.AddRange(_left.ToInstructions(start, temp)); - if (_left is MemberExpression member && member.Any()) - { - var i = start + lInstructions.Count; - var dest = "_t" + i; - var src = lInstructions.Any() - ? lInstructions.OfType().Last().Left - : member.Id; - var instruction = member.AccessChain.Tail switch - { - DotAccess dot => new Simple(dest, (new Name(src), new Constant(dot.Id, dot.Id)), ".", i), - IndexAccess index => new Simple(dest, (new Name(src), index.Expression.ToValue()), "[]", i), - _ => throw new NotImplementedException() - }; - lInstructions.Add(instruction); - } - newRight.left = new Name(lInstructions.OfType().Last().Left); - } - - if (_right.Primary()) - { - newRight.right = ((PrimaryExpression) _right).ToValue(); - } - else - { - var c = _left.Primary() - ? start - : lInstructions.Last().Number + 1; - rInstructions.AddRange(_right.ToInstructions(c, temp)); - if (_right is MemberExpression member && member.Any()) - { - var i = c + rInstructions.Count; - var dest = "_t" + i; - var src = rInstructions.Any() - ? rInstructions.OfType().Last().Left - : member.Id; - var instruction = member.AccessChain.Tail switch - { - DotAccess dot => new Simple(dest, (new Name(src), new Constant(dot.Id, dot.Id)), ".", i), - IndexAccess index => new Simple(dest, (new Name(src), index.Expression.ToValue()), "[]", i), - _ => throw new NotImplementedException() - }; - rInstructions.Add(instruction); - } - newRight.right = new Name(rInstructions.OfType().Last().Left); - } - - instructions.AddRange(lInstructions); - instructions.AddRange(rInstructions); - - var number = instructions.Any() ? instructions.Last().Number + 1 : start; - - instructions.Add - ( - new Simple( - temp + number, - newRight, _operator, number - ) - ); - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/CallExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/CallExpression.cs deleted file mode 100644 index 60d46166..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/CallExpression.cs +++ /dev/null @@ -1,195 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Statements; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class CallExpression : Expression -{ - private readonly MemberExpression _ident; - private readonly List _expressions; - - public CallExpression(MemberExpression ident, IEnumerable expressions) - { - _ident = ident; - _ident.Parent = this; - - _expressions = new List(expressions); - _expressions.ForEach(expr => expr.Parent = this); - } - - private FunctionSymbol GetFunction() - { - if (_ident.Any()) - { - var table = SymbolTable.FindSymbol(_ident.Id).Table; - var chain = _ident.AccessChain; - while (chain.HasNext()) - { - table = chain switch - { - DotAccess dot => table.FindSymbol(dot.Id).Table, - IndexAccess => throw new NotImplementedException(), - _ => throw new NotImplementedException() - }; - chain = chain.Next; - } - - return table.FindSymbol(((DotAccess) chain).Id); - } - - return SymbolTable.FindSymbol(_ident.Id); - } - - internal override Type NodeCheck() - { - if (_ident.Any()) - { - _ident.NodeCheck(); - } - else - { - IdentifierReference idRef = _ident; - idRef.NodeCheck(); - } - - var function = GetFunction(); - if (function == null) - { - throw new SymbolIsNotCallable(_ident.Id, Segment); - } - - if (!function.Type.ReturnType.Equals(TypeUtils.JavaScriptTypes.Void)) - { - if (!function.Body.HasReturnStatement()) - { - throw new FunctionWithoutReturnStatement(function.Body.Segment); - } - } - - function.Body.SetArguments(this, _expressions); - - var block = function.Body.First().GetAllNodes(); - foreach (var node in block) - { - if (node is ReturnStatement retStmt) - { - var retType = retStmt.NodeCheck(); - if (retType.Equals(function.Type.ReturnType)) - { - function.Body.Clear(); - return retType; - } - - throw new WrongReturnType(retStmt.Segment, function.Type.ReturnType, retType); - } - - if (node.CanEvaluate && !(node is CallExpression call && call._ident.Id == _ident.Id)) - { - node.NodeCheck(); - } - } - - function.Body.Clear(); - return TypeUtils.JavaScriptTypes.Void; - } - - public override IEnumerator GetEnumerator() - { - var nodes = new List - { - _ident - }; - nodes.AddRange(_expressions); - return nodes.GetEnumerator(); - } - - protected override string NodeRepresentation() => "()"; - - private List Print(int start) - { - var instructions = new List(); - var expression = _expressions.First(); - if (!expression.Primary()) - { - instructions.AddRange(expression.ToInstructions(start, "_t")); - instructions.Add(new Print( - instructions.Last().Number + 1, - new Name(instructions.OfType().Last().Left) - )); - } - else - { - instructions.Add(new Print(start, ((PrimaryExpression) expression).ToValue())); - } - - return instructions; - } - - public override List ToInstructions(int start) - { - return _ident.Id switch - { - "print" when !_ident.Any() => Print(start), - _ => ToInstructions(start, null) - }; - } - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - FunctionSymbol function; - if (!_ident.Any()) - { - function = SymbolTable.FindSymbol(_ident.Id); - } - else - { - function = GetFunction(); - instructions.AddRange(_ident.ToInstructions(start, temp)); - function.CallInfo.MethodOf = instructions.Any() - ? instructions.OfType().Last().Left - : function.CallInfo.MethodOf; - instructions.Add( - new PushParameter( - start + instructions.Count, - "this", new Name(function.CallInfo.MethodOf)) - ); - } - if (function.Body.First().Any()) - { - _expressions.Zip(function.Parameters).ToList<(Expression expr, Symbol param)>() - .ForEach(item => - { - var (expr, symbol) = item; - var paramInstructions = expr.Primary() - ? new List() - : expr.ToInstructions(start, "_t"); - var pushNumber = start + instructions.Count + paramInstructions.Count; - var pushValue = expr.Primary() - ? ((PrimaryExpression) expr).ToValue() - : new Name(paramInstructions.OfType().Last().Left); - paramInstructions.Add( - new PushParameter(pushNumber, symbol.Id, pushValue) - ); - instructions.AddRange(paramInstructions); - }); - var left = temp != null - ? temp + (start + instructions.Count) - : null; - instructions.Add( - new CallFunction( - function.CallInfo, - start + instructions.Count, - function.Parameters.Count, left - )); - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/CastAsExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/CastAsExpression.cs deleted file mode 100644 index 5c9f5503..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/CastAsExpression.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class CastAsExpression : Expression -{ - private readonly Expression _expression; - private readonly Type _cast; - - public CastAsExpression(Expression expression, Type cast) - { - _expression = expression; - _expression.Parent = this; - - _cast = cast; - } - - internal override Type NodeCheck() => - TypeUtils.JavaScriptTypes.String; - - public override IEnumerator GetEnumerator() - { - yield return _expression; - } - - protected override string NodeRepresentation() => $"as {_cast}"; - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - var castNumber = start; - - if (!_expression.Primary()) - { - instructions.AddRange(_expression.ToInstructions(start, "_t")); - castNumber = instructions.Last().Number + 1; - } - - instructions.Add(new AsString( - "_t" + castNumber, - _expression.Primary() - ? ((PrimaryExpression) _expression).ToValue() - : new Name(instructions.OfType().Last().Left), - castNumber - )); - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs deleted file mode 100644 index 8d555a68..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.ComplexLiterals; - -public class ArrayLiteral : Expression -{ - private readonly List _expressions; - - public ArrayLiteral(IEnumerable expressions) - { - _expressions = new List(expressions); - _expressions.ForEach(expr => expr.Parent = this); - } - - internal override Type NodeCheck() - { - if (_expressions.Any()) - { - var type = _expressions.First().NodeCheck(); - if (_expressions.All(e => e.NodeCheck().Equals(type))) - { - return new ArrayType(type); - } - - throw new WrongArrayLiteralDeclaration(Segment, type); - } - - return TypeUtils.JavaScriptTypes.Undefined; - } - - public override IEnumerator GetEnumerator() => - _expressions.GetEnumerator(); - - protected override string NodeRepresentation() => "[]"; - - public override List ToInstructions(int start, string temp) - { - if (Parent is not AssignmentExpression) - { - temp = "_t" + start; - } - var instructions = new List - { - new CreateArray(start, temp, _expressions.Count) - }; - var j = 1; - for (var i = 0; i < _expressions.Count; i++) - { - var expr = _expressions[i]; - var index = new Constant(i, i.ToString()); - if (expr is PrimaryExpression prim) - { - instructions.Add(new IndexAssignment(temp, (index, prim.ToValue()), start + j)); - j++; - } - else - { - var propInstructions = expr.ToInstructions(start + j, "_t" + (start + j)); - j += propInstructions.Count; - var left = propInstructions.OfType().Last().Left; - propInstructions.Add(new IndexAssignment(temp, (index, new Name(left)), start + j)); - j++; - instructions.AddRange(propInstructions); - } - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs deleted file mode 100644 index 4f59bed5..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.ComplexLiterals; - -public class ObjectLiteral : Expression -{ - private readonly List _properties; - private readonly List _methods; - - public ObjectLiteral(IEnumerable properties, IEnumerable methods) - { - _properties = new List(properties); - _properties.ForEach(prop => prop.Parent = this); - - _methods = new List(methods); - _methods.ForEach(m => m.Parent = this); - } - - internal override Type NodeCheck() - { - var propertyTypes = new List(); - _properties.ForEach(prop => - { - var propType = prop.Expression.NodeCheck(); - propertyTypes.Add(new PropertyType(prop.Id.Id, propType)); - prop.Id.SymbolTable.AddSymbol(propType is ObjectType objectType - ? new ObjectSymbol(prop.Id.Id, objectType) {Table = prop.Expression.SymbolTable} - : new VariableSymbol(prop.Id.Id, propType) - ); - }); - _methods.ForEach(m => - { - var symbol = m.GetSymbol(); - propertyTypes.Add(new PropertyType(symbol.Id, symbol.Type)); - }); - var type = new ObjectType(propertyTypes); - SymbolTable.AddSymbol(new VariableSymbol("this", type, true)); - return type; - } - - public override IEnumerator GetEnumerator() => - _properties.Concat(_methods).GetEnumerator(); - - protected override string NodeRepresentation() => "{}"; - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - _methods.ForEach(method => - { - var mInstructions = method.ToInstructions(start); - instructions.AddRange(mInstructions); - start += mInstructions.Count; - }); - - instructions.Add(new CreateObject(start, temp)); - var i = 1; - foreach (var (id, expr) in _properties) - { - if (expr is PrimaryExpression prim) - { - instructions.Add(new DotAssignment(temp, (new Constant(id, @$"\""{id}\"""), prim.ToValue()), start + i)); - i++; - } - else - { - var propInstructions = expr.ToInstructions(start + i, "_t" + (start + i)); - i += propInstructions.Count; - var left = propInstructions.OfType().Last().Left; - propInstructions.Add(new DotAssignment(temp, (new Constant(id, @$"\""{id}\"""), new Name(left)), start + i)); - i++; - instructions.AddRange(propInstructions); - } - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ConditionalExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/ConditionalExpression.cs deleted file mode 100644 index 2eafabaa..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/ConditionalExpression.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class ConditionalExpression : Expression -{ - private readonly Expression _test, _consequent, _alternate; - - public ConditionalExpression(Expression test, Expression consequent, Expression alternate) - { - _test = test; - _consequent = consequent; - _alternate = alternate; - - _test.Parent = this; - _consequent.Parent = this; - _alternate.Parent = this; - } - - internal override Type NodeCheck() - { - var tType = _test.NodeCheck(); - - if (tType.Equals(TypeUtils.JavaScriptTypes.Boolean)) - { - var cType = _consequent.NodeCheck(); - var aType = _alternate.NodeCheck(); - if (cType.Equals(aType)) - { - return cType; - } - - throw new WrongConditionalTypes(_consequent.Segment, cType, _alternate.Segment, aType); - } - - throw new NotBooleanTestExpression(_test.Segment, tType); - } - - public override IEnumerator GetEnumerator() - { - yield return _test; - yield return _consequent; - yield return _alternate; - } - - protected override string NodeRepresentation() => "?:"; - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - IValue ifNotTest; - if (!_test.Primary()) - { - var testInstructions = _test.ToInstructions(start, "_t"); - ifNotTest = new Name(testInstructions.OfType().Last().Left); - instructions.AddRange(testInstructions); - } - else - { - ifNotTest = ((PrimaryExpression) _test).ToValue(); - } - - var cOffset = start + instructions.Count + 1; - var consequentInstructions = _consequent.ToInstructions(cOffset, temp); - - var aOffset = consequentInstructions.Last().Number + 2; - var alternateInstructions = _alternate.ToInstructions(aOffset, temp); - - instructions.Add( - new IfNotGoto( - ifNotTest, alternateInstructions.First().Number, cOffset - 1 - ) - ); - instructions.AddRange(consequentInstructions); - instructions.OfType().Last().Left = temp; - - instructions.Add( - new Goto(alternateInstructions.Last().Number + 1, aOffset - 1) - ); - instructions.AddRange(alternateInstructions); - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/Expression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/Expression.cs deleted file mode 100644 index a4a678a8..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/Expression.cs +++ /dev/null @@ -1,15 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public abstract class Expression : AbstractSyntaxTreeNode -{ - protected Expression() - { - CanEvaluate = true; - } - - public bool Primary() => !this.Any(); - - public abstract List ToInstructions(int start, string temp); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/MemberExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/MemberExpression.cs deleted file mode 100644 index 596f8302..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/MemberExpression.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class MemberExpression : Expression -{ - private readonly IdentifierReference _id; - - public AccessExpression AccessChain { get; } - - public MemberExpression(IdentifierReference id, AccessExpression accessChain) - { - _id = id; - _id.Parent = this; - - AccessChain = accessChain; - if (accessChain != null) - { - AccessChain.Parent = this; - } - } - - public string Id => _id.Id; - - internal override Type NodeCheck() - { - if (AccessChain == null) - { - return _id.NodeCheck(); - } - - var symbol = SymbolTable.FindSymbol(_id.Id); - if (symbol == null) - { - throw new UnknownIdentifierReference(_id); - } - - return AccessChain.Check(symbol.Type); - } - - public override IEnumerator GetEnumerator() - { - if (AccessChain != null) - { - yield return AccessChain; - } - } - - protected override string NodeRepresentation() => Id; - - public override List ToInstructions(int start, string temp) - { - if (AccessChain != null && AccessChain.HasNext()) - { - return AccessChain.ToInstructions(start, _id.Id); - } - - return new(); - } - - public static implicit operator IdentifierReference(MemberExpression member) => - member._id; - - public static explicit operator MemberExpression(IdentifierReference idRef) => - new (idRef, null); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs deleted file mode 100644 index 7fd61bf9..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -public class IdentifierReference : PrimaryExpression -{ - public string Id { get; } - - public IdentifierReference(string id) - { - Id = id; - } - - internal override Type NodeCheck() - { - if (!ChildOf()) - { - var symbol = SymbolTable.FindSymbol(Id); - return symbol switch - { - VariableSymbol v => v.Type, - FunctionSymbol f => f.Type, - _ => throw new UnknownIdentifierReference(this) - }; - } - - return null; - } - - protected override string NodeRepresentation() => Id; - - public override IValue ToValue() => new Name(Id); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs deleted file mode 100644 index b0286598..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.FrontEnd.GetTokens.Data; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -public class Literal : PrimaryExpression -{ - private readonly Type _type; - private readonly object _value; - private readonly string _label; - - public Literal(Type type, object value, Segment segment = null, string label = null) - { - _type = type; - _label = label ?? value.ToString(); - _value = value; - Segment = segment; - } - - internal override Type NodeCheck() => _type; - - protected override string NodeRepresentation() => _label; - - public override IValue ToValue() => new Constant(_value, _label); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs deleted file mode 100644 index 15b785a4..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -public abstract class PrimaryExpression : Expression -{ - public override IEnumerator GetEnumerator() - { - yield break; - } - - public abstract IValue ToValue(); - - public override List ToInstructions(int start, string temp) => - new() - { - new Simple(temp, (null, ToValue()), "", start) - }; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Expressions/UnaryExpression.cs b/Interpreter.Lib/IR/Ast/Nodes/Expressions/UnaryExpression.cs deleted file mode 100644 index 4b2a4a1e..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Expressions/UnaryExpression.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.AccessExpressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Expressions; - -public class UnaryExpression : Expression -{ - private readonly string _operator; - - private readonly Expression _expression; - - public UnaryExpression(string @operator, Expression expression) - { - _operator = @operator; - - _expression = expression; - _expression.Parent = this; - } - - internal override Type NodeCheck() - { - var eType = _expression.NodeCheck(); - Type retType; - if (eType.Equals(TypeUtils.JavaScriptTypes.Number) && _operator == "-") - { - retType = TypeUtils.JavaScriptTypes.Number; - } - else if (eType.Equals(TypeUtils.JavaScriptTypes.Boolean) && _operator == "!") - { - retType = TypeUtils.JavaScriptTypes.Boolean; - } - else if (eType is ArrayType && _operator == "~") - { - retType = TypeUtils.JavaScriptTypes.Number; - } - else throw new UnsupportedOperation(Segment, eType, _operator); - - return retType; - } - - public override IEnumerator GetEnumerator() - { - yield return _expression; - } - - protected override string NodeRepresentation() => _operator; - - public override List ToInstructions(int start, string temp) - { - var instructions = new List(); - - (IValue left, IValue right) right = (null, null); - if (_expression.Primary()) - { - right.right = ((PrimaryExpression) _expression).ToValue(); - } - else - { - instructions.AddRange(_expression.ToInstructions(start, temp)); - if (_expression is MemberExpression member && member.Any()) - { - var i = start + instructions.Count; - var dest = "_t" + i; - var src = instructions.Any() - ? instructions.OfType().Last().Left - : member.Id; - var instruction = member.AccessChain.Tail switch - { - DotAccess dot => new Simple(dest, (new Name(src), new Constant(dot.Id, dot.Id)), ".", i), - IndexAccess index => new Simple(dest, (new Name(src), index.Expression.ToValue()), "[]", i), - _ => throw new NotImplementedException() - }; - instructions.Add(instruction); - } - right.right = new Name(instructions.OfType().Last().Left); - } - - var number = instructions.Any() ? instructions.Last().Number + 1 : start; - - instructions.Add(new Simple( - temp + number, right, _operator, number - )); - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/ScriptBody.cs b/Interpreter.Lib/IR/Ast/Nodes/ScriptBody.cs deleted file mode 100644 index b2fb2be3..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/ScriptBody.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes; - -public class ScriptBody : AbstractSyntaxTreeNode -{ - private readonly List _statementList; - - public ScriptBody(IEnumerable statementList) - { - _statementList = new List(statementList); - _statementList.ForEach(item => item.Parent = this); - } - - public override IEnumerator GetEnumerator() => _statementList.GetEnumerator(); - - protected override string NodeRepresentation() => "Script"; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/StatementListItem.cs b/Interpreter.Lib/IR/Ast/Nodes/StatementListItem.cs deleted file mode 100644 index 7adf45aa..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/StatementListItem.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes; - -public abstract class StatementListItem : AbstractSyntaxTreeNode -{ - public virtual bool IsStatement() => false; - - public virtual bool IsDeclaration() => false; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/BlockStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/BlockStatement.cs deleted file mode 100644 index 004e0ed3..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/BlockStatement.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class BlockStatement : Statement -{ - private readonly List _statementList; - - public BlockStatement(IEnumerable statementList) - { - _statementList = new List(statementList); - _statementList.ForEach(item => item.Parent = this); - } - - public bool HasReturnStatement() - { - var has = _statementList.Any(item => item is ReturnStatement); - if (!has) - { - has = _statementList - .Where(item => item.IsStatement()) - .OfType() - .Any(ifStmt => ifStmt.HasReturnStatement()); - } - - return has; - } - - public override IEnumerator GetEnumerator() => _statementList.GetEnumerator(); - - protected override string NodeRepresentation() => "{}"; - - public override List ToInstructions(int start) - { - var blockInstructions = new List(); - var offset = start; - foreach (var item in _statementList) - { - var itemInstructions = item.ToInstructions(offset); - blockInstructions.AddRange(itemInstructions); - if (item is ReturnStatement) - { - break; - } - - offset += itemInstructions.Count; - } - - return blockInstructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/BreakStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/BreakStatement.cs deleted file mode 100644 index c1cfb42b..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/BreakStatement.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class BreakStatement : InsideLoopStatement -{ - protected override string NodeRepresentation() => "break"; - - public override List ToInstructions(int start) => - new() - { - new Goto(-1, start) - }; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/ContinueStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/ContinueStatement.cs deleted file mode 100644 index d4374d10..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/ContinueStatement.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class ContinueStatement : InsideLoopStatement -{ - protected override string NodeRepresentation() => "continue"; - - public override List ToInstructions(int start) => - new() - { - new Goto(-2, start) - }; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/ExpressionStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/ExpressionStatement.cs deleted file mode 100644 index bba3d9b0..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/ExpressionStatement.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class ExpressionStatement : Statement -{ - private readonly Expression _expression; - - public ExpressionStatement(Expression expression) - { - _expression = expression; - expression.Parent = this; - } - - public override IEnumerator GetEnumerator() - { - yield return _expression; - } - - protected override string NodeRepresentation() => nameof(ExpressionStatement); - - public override List ToInstructions(int start) => _expression.ToInstructions(start); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/IfStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/IfStatement.cs deleted file mode 100644 index f18fe08c..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/IfStatement.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class IfStatement : Statement -{ - private readonly Expression _test; - private readonly Statement _then; - private readonly Statement _else; - - public IfStatement(Expression test, Statement then, Statement @else = null) - { - _test = test; - _test.Parent = this; - - _then = then; - _then.Parent = this; - - if (@else != null) - { - _else = @else; - _else.Parent = this; - } - - CanEvaluate = true; - } - - public bool HasReturnStatement() - { - var thenResult = _then is ReturnStatement; - if (!thenResult) - { - if (_then is BlockStatement block) - { - thenResult = block.HasReturnStatement(); - } - } - - var elseResult = _else == null || _else is ReturnStatement; - if (!elseResult) - { - if (_else is BlockStatement block) - { - elseResult = block.HasReturnStatement(); - } - } - - return thenResult && elseResult; - } - - public override IEnumerator GetEnumerator() - { - yield return _test; - yield return _then; - if (_else != null) - { - yield return _else; - } - } - - internal override Type NodeCheck() - { - var testType = _test.NodeCheck(); - if (!testType.Equals(TypeUtils.JavaScriptTypes.Boolean)) - { - throw new NotBooleanTestExpression(Segment, testType); - } - - return testType; - } - - protected override string NodeRepresentation() => "if"; - - public override List ToInstructions(int start) - { - var instructions = new List(); - if (_then.Any() && (_else == null || _else.Any())) - { - IValue ifNotTest; - if (!_test.Primary()) - { - var testInstructions = _test.ToInstructions(start, "_t"); - ifNotTest = new Name(testInstructions.OfType().Last().Left); - instructions.AddRange(testInstructions); - } - else - { - ifNotTest = ((PrimaryExpression) _test).ToValue(); - } - - var tOffset = start + instructions.Count + 1; - var thenInstructions = _then.ToInstructions(tOffset); - - var eOffset = thenInstructions.Any() - ? thenInstructions.Last().Number + 2 - : tOffset + 1; - var elseInstructions = _else?.ToInstructions(eOffset); - - instructions.Add( - new IfNotGoto( - ifNotTest, elseInstructions?.First().Number ?? eOffset - 1, tOffset - 1 - ) - ); - - instructions.AddRange(thenInstructions); - - if (elseInstructions != null) - { - instructions.Add( - new Goto( - elseInstructions.Last().Number + 1, - eOffset - 1 - ) - ); - instructions.AddRange(elseInstructions); - } - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/InsideLoopStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/InsideLoopStatement.cs deleted file mode 100644 index 77744c3a..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/InsideLoopStatement.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Exceptions; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public abstract class InsideLoopStatement : Statement -{ - protected InsideLoopStatement() - { - CanEvaluate = true; - } - - internal override Type NodeCheck() - { - if (!ChildOf()) - { - throw new OutsideOfLoop(Segment, NodeRepresentation()); - } - return null; - } - - public override IEnumerator GetEnumerator() - { - yield break; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/ReturnStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/ReturnStatement.cs deleted file mode 100644 index a69cb44f..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/ReturnStatement.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class ReturnStatement : Statement -{ - private readonly Expression _expression; - - public ReturnStatement(Expression expression = null) - { - _expression = expression; - CanEvaluate = true; - if (expression != null) - { - _expression.Parent = this; - } - } - - internal override Type NodeCheck() - { - if (!ChildOf()) - { - throw new ReturnOutsideFunction(Segment); - } - - return _expression?.NodeCheck() ?? TypeUtils.JavaScriptTypes.Void; - } - - public override IEnumerator GetEnumerator() - { - if (_expression == null) - { - yield break; - } - - yield return _expression; - } - - protected override string NodeRepresentation() => "return"; - - private FunctionSymbol GetCallee() - { - var parent = Parent; - while (parent != null) - { - if (parent is FunctionDeclaration declaration) - { - return declaration.GetSymbol(); - } - - parent = parent.Parent; - } - - return null; - } - - public override List ToInstructions(int start) - { - var instructions = new List(); - if (_expression == null) - { - instructions.Add(new Return(GetCallee().CallInfo.Location, start)); - } - else - { - if (_expression.Primary()) - { - instructions.Add(new Return( - GetCallee().CallInfo.Location, start, ((PrimaryExpression) _expression).ToValue()) - ); - } - else - { - var eInstructions = _expression.ToInstructions(start, "_t"); - var last = eInstructions.OfType().Last(); - instructions.AddRange(eInstructions); - instructions.Add(new Return( - GetCallee().CallInfo.Location, last.Number + 1, new Name(last.Left) - )); - } - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/Statement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/Statement.cs deleted file mode 100644 index 2a4f7f0d..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/Statement.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public abstract class Statement : StatementListItem -{ - public override bool IsStatement() => true; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/TypeStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/TypeStatement.cs deleted file mode 100644 index 07563b27..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/TypeStatement.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class TypeStatement : Statement -{ - private readonly string _typeId; - private readonly Type _typeValue; - - public TypeStatement(string typeId, Type typeValue) - { - _typeId = typeId; - _typeValue = typeValue; - } - - public override IEnumerator GetEnumerator() - { - yield break; - } - - protected override string NodeRepresentation() => - $"type {_typeId} = {_typeValue}"; -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/Ast/Nodes/Statements/WhileStatement.cs b/Interpreter.Lib/IR/Ast/Nodes/Statements/WhileStatement.cs deleted file mode 100644 index 77f4e052..00000000 --- a/Interpreter.Lib/IR/Ast/Nodes/Statements/WhileStatement.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Interpreter.Lib.IR.CheckSemantics.Exceptions; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.Ast.Nodes.Statements; - -public class WhileStatement : Statement -{ - private readonly Expression _condition; - private readonly Statement _statement; - - public WhileStatement(Expression condition, Statement statement) - { - _condition = condition; - _condition.Parent = this; - - _statement = statement; - _statement.Parent = this; - - CanEvaluate = true; - } - - public override IEnumerator GetEnumerator() - { - yield return _condition; - yield return _statement; - } - - internal override Type NodeCheck() - { - var condType = _condition.NodeCheck(); - if (!condType.Equals(TypeUtils.JavaScriptTypes.Boolean)) - { - throw new NotBooleanTestExpression(Segment, condType); - } - - return condType; - } - - protected override string NodeRepresentation() => "while"; - - public override List ToInstructions(int start) - { - var instructions = new List(); - IValue ifNotTest; - if (!_condition.Primary()) - { - var conditionInstructions = _condition.ToInstructions(start, "_t"); - ifNotTest = new Name(conditionInstructions.OfType().Last().Left); - instructions.AddRange(conditionInstructions); - } - else - { - ifNotTest = ((PrimaryExpression) _condition).ToValue(); - } - - var cOffset = start + instructions.Count + 1; - var loopBody = _statement.ToInstructions(cOffset); - if (loopBody.Any()) - { - instructions.Add(new IfNotGoto(ifNotTest, loopBody.Last().Number + 2, cOffset - 1)); - instructions.AddRange(loopBody); - instructions.Add(new Goto(start, loopBody.Last().Number + 1)); - - loopBody - .OfType() - .Where(g => g.Jump() < 0) - .ToList() - .ForEach(j => - { - if (j.Jump() == -1) - { - j.SetJump(loopBody.Last().Number + 2); - } - else if (j.Jump() == -2) - { - j.SetJump(start); - } - }); - } - else - { - instructions.Clear(); - } - - return instructions; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs deleted file mode 100644 index 353b87ea..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class AssignmentToConst : SemanticException -{ - public AssignmentToConst(IdentifierReference ident) : - base(ident.Segment,$"Cannot assign to const: {ident.Id}") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs deleted file mode 100644 index 2a2dd640..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class CannotDefineType : SemanticException -{ - public CannotDefineType(Segment segment) : - base(segment, "Cannot define type") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs deleted file mode 100644 index 9d451dd1..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class ConstWithoutInitializer : SemanticException -{ - public ConstWithoutInitializer(IdentifierReference ident) : - base(ident.Segment, $"Const without initializer: {ident.Id}") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs deleted file mode 100644 index ddb751f9..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class DeclarationAlreadyExists : SemanticException -{ - public DeclarationAlreadyExists(IdentifierReference ident) : - base(ident.Segment, $"Declaration already exists: {ident.Id}") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/OutsideOfLoop.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/OutsideOfLoop.cs deleted file mode 100644 index 2049c6cf..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/OutsideOfLoop.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class OutsideOfLoop : SemanticException -{ - public OutsideOfLoop(Segment segment, string keyword) : - base(segment, $"\"{keyword}\" outside of loop") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs deleted file mode 100644 index 5f3609e5..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class SymbolIsNotCallable: SemanticException -{ - public SymbolIsNotCallable(string symbol, Segment segment) : - base(segment, $"Symbol is not callable: {symbol}") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs b/Interpreter.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs deleted file mode 100644 index 99397033..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; - -namespace Interpreter.Lib.IR.CheckSemantics.Exceptions; - -public class UnknownIdentifierReference : SemanticException -{ - public UnknownIdentifierReference(IdentifierReference ident) : - base(ident.Segment, $"Unknown identifier reference: {ident.Id}") { } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/ArrayType.cs b/Interpreter.Lib/IR/CheckSemantics/Types/ArrayType.cs deleted file mode 100644 index 5ba7fdee..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/ArrayType.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Types.Visitors; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public class ArrayType : Type -{ - public Type Type { get; set; } - - public ArrayType(Type type) : base($"{type}[]") - { - Type = type; - } - - public override Unit Accept(ReferenceResolver visitor) => - visitor.Visit(this); - - public override string Accept(ObjectTypePrinter visitor) => - visitor.Visit(this); - - public override int Accept(ObjectTypeHasher visitor) => - visitor.Visit(this); - - public override bool Equals(object obj) - { - if (ReferenceEquals(this, obj)) return true; - if (obj == null || GetType() != obj.GetType()) return false; - var that = (ArrayType) obj; - return Equals(Type, that.Type); - } - - public override int GetHashCode() => - // ReSharper disable once NonReadonlyMemberInGetHashCode - Type.GetHashCode(); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/FunctionType.cs b/Interpreter.Lib/IR/CheckSemantics/Types/FunctionType.cs deleted file mode 100644 index 98f3296b..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/FunctionType.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Text; -using Interpreter.Lib.IR.CheckSemantics.Types.Visitors; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public class FunctionType : Type -{ - public Type ReturnType { get; set; } - - public List Arguments { get; } - - public FunctionType(Type returnType, IEnumerable arguments) - { - ReturnType = returnType; - Arguments = new List(arguments); - } - - public override Unit Accept(ReferenceResolver visitor) => - visitor.Visit(this); - - public override string Accept(ObjectTypePrinter visitor) => - visitor.Visit(this); - - public override int Accept(ObjectTypeHasher visitor) => - visitor.Visit(this); - - public override bool Equals(object obj) - { - if (ReferenceEquals(this, obj)) return true; - if (obj == null || GetType() != obj.GetType()) return false; - var that = (FunctionType) obj; - return ReturnType.Equals(that.ReturnType) && - Arguments.Count == that.Arguments.Count && - Arguments.Zip(that.Arguments) - .All(pair => pair.First.Equals(pair.Second)); - } - - public override int GetHashCode() => - HashCode.Combine( - // ReSharper disable once NonReadonlyMemberInGetHashCode - ReturnType, - Arguments - .Select(arg => arg.GetHashCode()) - .Aggregate(36, HashCode.Combine) - ); - - public override string ToString() => - new StringBuilder() - .Append('(') - .AppendJoin(", ", Arguments) - .Append(')') - .Append(" => ") - .Append(ReturnType) - .ToString(); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/NullableType.cs b/Interpreter.Lib/IR/CheckSemantics/Types/NullableType.cs deleted file mode 100644 index 489d0a4e..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/NullableType.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Types.Visitors; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public class NullableType : Type -{ - public Type Type { get; set; } - - public NullableType(Type type) : base($"{type}?") - { - Type = type; - } - - protected NullableType() - { - } - - public override Unit Accept(ReferenceResolver visitor) => - visitor.Visit(this); - - public override string Accept(ObjectTypePrinter visitor) => - visitor.Visit(this); - - public override int Accept(ObjectTypeHasher visitor) => - visitor.Visit(this); - - public override bool Equals(object obj) - { - if (obj is NullableType that) - { - return Type.Equals(that.Type); - } - return obj is NullType; - } - - public override int GetHashCode() => - // ReSharper disable once NonReadonlyMemberInGetHashCode - Type.GetHashCode(); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/ObjectType.cs b/Interpreter.Lib/IR/CheckSemantics/Types/ObjectType.cs deleted file mode 100644 index 57f30446..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/ObjectType.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Types.Visitors; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public class ObjectType : NullableType -{ - private readonly Dictionary _properties; - private readonly ObjectTypeHasher _hasher; - private readonly ObjectTypePrinter _serializer; - - public ObjectType(IEnumerable properties) - { - _properties = properties - .OrderBy(x => x.Id) - .ToDictionary( - x => x.Id, - x => x.Type - ); - _hasher = new ObjectTypeHasher(this); - _serializer = new ObjectTypePrinter(this); - } - - public Type this[string id] - { - get => _properties.ContainsKey(id) - ? _properties[id] - : null; - set => _properties[id] = value; - } - - public IEnumerable Keys => _properties.Keys; - - public void ResolveSelfReferences(string self) => - new ReferenceResolver(this, self) - .Visit(this); - - public override Unit Accept(ReferenceResolver visitor) => - visitor.Visit(this); - - public override string Accept(ObjectTypePrinter visitor) => - visitor.Visit(this); - - public override int Accept(ObjectTypeHasher visitor) => - visitor.Visit(this); - - public override bool Equals(object obj) - { - if (obj is ObjectType that) - { - return ReferenceEquals(this, that) || _properties.Count == that._properties.Count && - _properties - .Zip(that._properties) - .All(pair => - pair.First.Key == pair.Second.Key && - pair.First.Value.Equals(pair.Second.Value) - ); - } - - return obj is NullType; - } - - public override int GetHashCode() => - _hasher.Visit(this); - - public override string ToString() => - _serializer.Visit(this); -} - -public record PropertyType(string Id, Type Type); \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/Type.cs b/Interpreter.Lib/IR/CheckSemantics/Types/Type.cs deleted file mode 100644 index 4b1d7aa5..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/Type.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Types.Visitors; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public class Type : - IVisitable, - IVisitable, - IVisitable -{ - private readonly string _name; - - protected Type() - { - } - - public Type(string name) => _name = name; - - public bool Recursive { get; set; } - - public virtual Unit Accept(ReferenceResolver visitor) => - visitor.Visit(this); - - public virtual string Accept(ObjectTypePrinter visitor) => - visitor.Visit(this); - - public virtual int Accept(ObjectTypeHasher visitor) => - visitor.Visit(this); - - public override bool Equals(object obj) - { - if (ReferenceEquals(this, obj)) return true; - if (obj == null || GetType() != obj.GetType()) return false; - var that = (Type) obj; - return Equals(_name, that._name); - } - - public override int GetHashCode() => - _name.GetHashCode(); - - public override string ToString() => _name; - - public static implicit operator Type(string alias) => new(alias); - - public static bool operator ==(Type left, Type right) => Equals(left, right); - - public static bool operator !=(Type left, Type right) => !(left == right); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/TypeUtils.cs b/Interpreter.Lib/IR/CheckSemantics/Types/TypeUtils.cs deleted file mode 100644 index 7f78bc92..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/TypeUtils.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace Interpreter.Lib.IR.CheckSemantics.Types; - -public static class TypeUtils -{ - public static ( - Type Number, Type Boolean, Type String, Type Null, Type Undefined, Type Void - ) JavaScriptTypes { get; } = ( - new Type("number"), - new Type("boolean"), - new Type("string"), - new NullType(), - new Type("undefined"), - new Type("void") - ); - - public static object GetDefaultValue(Type type) - { - if (type.Equals(JavaScriptTypes.Boolean)) - return false; - if (type.Equals(JavaScriptTypes.Number)) - return 0; - if (type.Equals(JavaScriptTypes.String)) - return ""; - if (type.Equals(JavaScriptTypes.Void)) - return new Void(); - if (type.Equals(JavaScriptTypes.Null)) - return null; - if (type is ArrayType) - return new List(); - - return new Undefined(); - } - - public struct Undefined - { - public override string ToString() => JavaScriptTypes.Undefined.ToString(); - } - - private struct Void - { - public override string ToString() => JavaScriptTypes.Void.ToString(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypeHasher.cs b/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypeHasher.cs deleted file mode 100644 index ef33b5ef..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypeHasher.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types.Visitors; - -public class ObjectTypeHasher : - IVisitor, - IVisitor, - IVisitor, - IVisitor, - IVisitor -{ - private readonly ObjectType _reference; - - public ObjectTypeHasher(ObjectType reference) => - _reference = reference; - - public int Visit(Type visitable) => - visitable.GetHashCode(); - - public int Visit(ObjectType visitable) => - visitable.Keys.Select(key => HashCode.Combine(key, - visitable[key].Equals(_reference) - ? "@this".GetHashCode() - : visitable[key].Recursive - ? key.GetHashCode() - : visitable[key].Accept(this)) - ).Aggregate(36, HashCode.Combine); - - public int Visit(ArrayType visitable) => - visitable.Type.Equals(_reference) - ? "@this".GetHashCode() - : visitable.Type.Accept(this); - - public int Visit(NullableType visitable) => - visitable.Type.Equals(_reference) - ? "@this".GetHashCode() - : visitable.Type.Accept(this); - - public int Visit(FunctionType visitable) => - HashCode.Combine( - visitable.ReturnType.Equals(_reference) - ? "@this".GetHashCode() - : visitable.ReturnType.Accept(this), - visitable.Arguments.Select(arg => - arg.Equals(_reference) - ? "@this".GetHashCode() - : arg.Accept(this) - ).Aggregate(36, HashCode.Combine)); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypePrinter.cs b/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypePrinter.cs deleted file mode 100644 index 1f11d91a..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ObjectTypePrinter.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.Text; -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types.Visitors; - -public class ObjectTypePrinter : - IVisitor, - IVisitor, - IVisitor, - IVisitor, - IVisitor -{ - private readonly ObjectType _reference; - - public ObjectTypePrinter(ObjectType reference) => - _reference = reference; - - public string Visit(Type visitable) => - visitable.ToString(); - - public string Visit(ObjectType visitable) - { - var sb = new StringBuilder("{"); - foreach (var key in visitable.Keys) - { - var type = visitable[key]; - var prop = $"{key}: "; - prop += type.Equals(_reference) - ? "@this" - : type.Recursive - ? key - : type.Accept(this); - sb.Append(prop).Append(';'); - } - - return sb.Append('}').ToString(); - } - - public string Visit(ArrayType visitable) - { - var sb = new StringBuilder(); - sb.Append(visitable.Type.Equals(_reference) - ? "@this" - : visitable.Type.Accept(this) - ); - - return sb.Append("[]").ToString(); - } - - public string Visit(NullableType visitable) - { - var sb = new StringBuilder(); - sb.Append(visitable.Type.Equals(_reference) - ? "@this" - : visitable.Type.Accept(this) - ); - - return sb.Append('?').ToString(); - } - - public string Visit(FunctionType visitable) - { - var sb = new StringBuilder("("); - sb.AppendJoin(", ", visitable.Arguments.Select(x => x.Equals(_reference) - ? "@this" - : x.Accept(this) - )).Append(") => "); - sb.Append(visitable.ReturnType.Equals(_reference) - ? "@this" - : visitable.ReturnType.Accept(this) - ); - - return sb.ToString(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ReferenceResolver.cs b/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ReferenceResolver.cs deleted file mode 100644 index 483654f0..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Types/Visitors/ReferenceResolver.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Visitor.NET.Lib.Core; - -namespace Interpreter.Lib.IR.CheckSemantics.Types.Visitors; - -public class ReferenceResolver : - IVisitor, - IVisitor, - IVisitor, - IVisitor, - IVisitor -{ - private readonly ObjectType _reference; - private readonly string _refId; - private readonly HashSet _visited; - - public ReferenceResolver(ObjectType reference, string refId) - { - _reference = reference; - _refId = refId; - _visited = new(); - } - - public Unit Visit(ObjectType visitable) - { - if (_visited.Contains(visitable)) - return default; - _visited.Add(visitable); - - foreach (var key in visitable.Keys) - if (_refId == visitable[key]) - visitable[key] = _reference; - else - visitable[key].Accept(this); - return default; - } - - public Unit Visit(Type visitable) => default; - - public Unit Visit(ArrayType visitable) - { - if (visitable.Type == _refId) - visitable.Type = _reference; - else - visitable.Type.Accept(this); - return default; - } - - public Unit Visit(FunctionType visitable) - { - if (visitable.ReturnType == _refId) - visitable.ReturnType = _reference; - else - visitable.ReturnType.Accept(this); - - for (var i = 0; i < visitable.Arguments.Count; i++) - { - var argType = visitable.Arguments[i]; - if (argType == _refId) - visitable.Arguments[i] = _reference; - else - argType.Accept(this); - } - - return default; - } - - public Unit Visit(NullableType visitable) - { - if (visitable.Type == _refId) - visitable.Type = _reference; - else - visitable.Type.Accept(this); - return default; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTable.cs b/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTable.cs deleted file mode 100644 index 2a7d33f4..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTable.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.CheckSemantics.Variables; - -public class SymbolTable -{ - private readonly Dictionary _symbols = new(); - private readonly Dictionary _types = new(); - - private SymbolTable _openScope; - - public void AddOpenScope(SymbolTable table) - { - _openScope = table; - } - - public void AddSymbol(Symbol symbol) => _symbols[symbol.Id] = symbol; - - public void AddType(Type type, string typeId = null) => - _types[typeId ?? type.ToString()] = type; - - public Type FindType(string typeId) - { - var hasInsideTheScope = _types.TryGetValue(typeId, out var type); - return !hasInsideTheScope ? _openScope?.FindType(typeId) : type; - } - - /// - /// Поиск эффективного символа - /// - public T FindSymbol(string id) where T : Symbol - { - var hasInsideTheScope = _symbols.TryGetValue(id, out var symbol); - return !hasInsideTheScope ? _openScope?.FindSymbol(id) : symbol as T; - } - - /// - /// Проверяет наличие собственного символа - /// - public bool ContainsSymbol(string id) => _symbols.ContainsKey(id); - - public void Clear() => _symbols.Clear(); -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTableUtils.cs b/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTableUtils.cs deleted file mode 100644 index b9b228da..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/SymbolTableUtils.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; -using Interpreter.Lib.IR.Ast.Nodes; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Statements; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace Interpreter.Lib.IR.CheckSemantics.Variables; - -public static class SymbolTableUtils -{ - public static SymbolTable GetStandardLibrary() - { - var library = new SymbolTable(); - - library.AddType(TypeUtils.JavaScriptTypes.Number); - library.AddType(TypeUtils.JavaScriptTypes.Boolean); - library.AddType(TypeUtils.JavaScriptTypes.String); - library.AddType(TypeUtils.JavaScriptTypes.Null); - library.AddType(TypeUtils.JavaScriptTypes.Void); - - var print = new FunctionSymbol( - "print", - new List - { - new VariableSymbol("str", TypeUtils.JavaScriptTypes.String) - }, - new FunctionType(TypeUtils.JavaScriptTypes.Void, new[] {TypeUtils.JavaScriptTypes.String}) - ); - print.Body = new FunctionDeclaration( - print, - new BlockStatement(new List()) - { - SymbolTable = new SymbolTable() - } - ) - { - SymbolTable = new SymbolTable(), - Segment = new Segment( - new Coordinates(0, 0), - new Coordinates(0, 0) - ) - }; - - library.AddSymbol(print); - - var symbolTable = new SymbolTable(); - symbolTable.AddOpenScope(library); - return symbolTable; - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs b/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs deleted file mode 100644 index a7144623..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Text; -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -public class FunctionSymbol : Symbol -{ - public override FunctionType Type { get; } - - public List Parameters { get; } - - public FunctionDeclaration Body { get; set; } - - public FunctionInfo CallInfo { get; } - - public FunctionSymbol(string id, IEnumerable parameters, FunctionType type) : - base(id, type) - { - Parameters = new List(parameters); - CallInfo = new FunctionInfo(id); - Type = type; - } - - public override string ToString() - { - var sb = new StringBuilder($"function {Id}("); - sb.AppendJoin(',', Parameters); - sb.Append($") => {Type.ReturnType}"); - return sb.ToString(); - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs b/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs deleted file mode 100644 index efb9672e..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Types; - -namespace Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -public class ObjectSymbol : VariableSymbol -{ - public override ObjectType Type { get; } - - public SymbolTable Table { get; init; } - - public ObjectSymbol(string id, ObjectType objectType, bool readOnly = false, SymbolTable table = null) : - base(id, objectType, readOnly) - { - Type = objectType; - if (table != null) - { - foreach (var key in objectType.Keys) - { - if (objectType[key] is FunctionType) - { - var function = table.FindSymbol(key); - function.CallInfo.MethodOf = id; - } - } - } - } -} \ No newline at end of file diff --git a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs b/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs deleted file mode 100644 index 87b487c8..00000000 --- a/Interpreter.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; - -public abstract class Symbol -{ - // ReSharper disable once VirtualMemberNeverOverridden.Global - public virtual string Id { get; } - - public virtual Type Type { get; } - - protected Symbol(string id, Type type) => - (Id, Type) = (id, type); -} \ No newline at end of file diff --git a/Interpreter.Tests/GlobalUsings.cs b/Interpreter.Tests/GlobalUsings.cs deleted file mode 100644 index 9f96c142..00000000 --- a/Interpreter.Tests/GlobalUsings.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Global using directives - -global using Type = Interpreter.Lib.IR.CheckSemantics.Types.Type; \ No newline at end of file diff --git a/Interpreter.Tests/MockExtensions.cs b/Interpreter.Tests/MockExtensions.cs deleted file mode 100644 index 1b88106b..00000000 --- a/Interpreter.Tests/MockExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.BackEnd.Instructions; -using Microsoft.Extensions.Options; -using Moq; - -namespace Interpreter.Tests; - -public static class MockExtensions -{ - public static Mock Trackable(this Mock halt) - { - halt.Setup(x => x.Execute(It.IsAny())) - .Returns(-3).Verifiable(); - halt.Setup(x => x.End()).Returns(true); - return halt; - } - - public static IOptions ToOptions - (this Mock commandLineSettings) => - Options.Create(commandLineSettings.Object); -} \ No newline at end of file diff --git a/Interpreter.Tests/Stubs/SemanticExceptionStub.cs b/Interpreter.Tests/Stubs/SemanticExceptionStub.cs deleted file mode 100644 index c1cc2463..00000000 --- a/Interpreter.Tests/Stubs/SemanticExceptionStub.cs +++ /dev/null @@ -1,5 +0,0 @@ -using Interpreter.Lib.IR.CheckSemantics.Exceptions; - -namespace Interpreter.Tests.Stubs; - -public class SemanticExceptionStub : SemanticException { } \ No newline at end of file diff --git a/Interpreter.Tests/TestData/InstructionsData.cs b/Interpreter.Tests/TestData/InstructionsData.cs deleted file mode 100644 index 2eb25f8b..00000000 --- a/Interpreter.Tests/TestData/InstructionsData.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections; -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; - -namespace Interpreter.Tests.TestData; - -public class InstructionsData : IEnumerable -{ - public IEnumerator GetEnumerator() - { - yield return new object[] - { - new AsString("str", new Name("num"), 0), - "0: str = num as string" - }; - yield return new object[] - { - new BeginFunction(1, new FunctionInfo("func", 1)), - "1: BeginFunction func" - }; - yield return new object[] - { - new CallFunction(new FunctionInfo("func"), 2, 0), - "2: Call (0, func), 0" - }; - yield return new object[] - { - new CallFunction(new FunctionInfo("func"), 2, 0, "ret"), - "2: ret = Call (0, func), 0" - }; - yield return new object[] - { - new CreateArray(3, "arr", 5), - "3: array arr = [5]" - }; - yield return new object[] - { - new CreateObject(4, "obj"), - "4: object obj = {}" - }; - yield return new object[] - { - new DotAssignment("obj", (new Constant("prop", "prop"), new Constant(3, "3")), 5), - "5: obj.prop = 3" - }; - yield return new object[] - { - new Goto(10, 6), - "6: Goto 10" - }; - yield return new object[] - { - new Halt(7), - "7: End" - }; - yield return new object[] - { - new IfNotGoto(new Name("test"), 17, 8), - "8: IfNot test Goto 17" - }; - yield return new object[] - { - new IndexAssignment("arr", (new Constant(1, "1"), new Constant(1, "1")), 9), - "9: arr[1] = 1" - }; - yield return new object[] - { - new Print(10, new Name("str")), - "10: Print str" - }; - yield return new object[] - { - new PushParameter(11, "param", new Name("value")), - "11: PushParameter param = value" - }; - yield return new object[] - { - new RemoveFromArray(12, "arr", new Constant(0, "0")), - "12: RemoveFrom arr at 0" - }; - yield return new object[] - { - new Return(3, 13), - "13: Return" - }; - yield return new object[] - { - new Return(3, 13, new Name("result")), - "13: Return result" - }; - yield return new object[] - { - new Simple("a", (new Name("b"), new Name("c")), "+", 14), - "14: a = b + c" - }; - yield return new object[] - { - new Simple("b", (null, new Name("c")), "-", 14), - "14: b = -c" - }; - } - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); -} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/BackEnd/FunctionInfoTests.cs b/Interpreter.Tests/Unit/BackEnd/FunctionInfoTests.cs deleted file mode 100644 index f0fc3116..00000000 --- a/Interpreter.Tests/Unit/BackEnd/FunctionInfoTests.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Interpreter.Lib.BackEnd; -using Xunit; - -namespace Interpreter.Tests.Unit.BackEnd; - -public class FunctionInfoTests -{ - [Theory] - [InlineData("func", null, "func")] - [InlineData("func", "obj", "obj.func")] - public void CallIdCorrectTest(string id, string methodOf, string expected) => - Assert.Equal(expected, new FunctionInfo(id, 0, methodOf).CallId()); -} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/BackEnd/InstructionsTests.cs b/Interpreter.Tests/Unit/BackEnd/InstructionsTests.cs deleted file mode 100644 index 6111c5d7..00000000 --- a/Interpreter.Tests/Unit/BackEnd/InstructionsTests.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Tests.TestData; -using Moq; -using Xunit; - -namespace Interpreter.Tests.Unit.BackEnd; - -public class InstructionsTests -{ - [Theory] - [ClassData(typeof(InstructionsData))] - public void ToStringCorrectTest(Instruction instruction, string expected) => - Assert.Equal(expected, instruction.ToString()); - - [Fact] - public void ComparisonDependsOnAddressTest() - { - var instruction1 = new Mock(1).Object; - var instruction2 = new Mock(2).Object; - - Assert.Equal(1, instruction2.CompareTo(instruction1)); - } - - [Fact] - public void GotoJumpChangedTest() - { - var @goto = new Goto(0, 1); - @goto.SetJump(5); - Assert.Equal(5, @goto.Jump()); - } - - [Fact] - public void ReturnCallersAddedTest() - { - var @return = new Return(7, 19); - @return.AddCaller(@return.FunctionStart - 2); - Assert.NotEmpty(@return); - } -} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/BackEnd/VirtualMachineTests.cs b/Interpreter.Tests/Unit/BackEnd/VirtualMachineTests.cs deleted file mode 100644 index 28a8234e..00000000 --- a/Interpreter.Tests/Unit/BackEnd/VirtualMachineTests.cs +++ /dev/null @@ -1,131 +0,0 @@ -#nullable enable -using Interpreter.Lib.BackEnd; -using Interpreter.Lib.BackEnd.Instructions; -using Interpreter.Lib.BackEnd.Values; -using Moq; -using Xunit; - -namespace Interpreter.Tests.Unit.BackEnd; - -public class VirtualMachineTests -{ - private readonly VirtualMachine _vm; - - public VirtualMachineTests() - { - _vm = new(new(), new(), new(), TextWriter.Null); - } - - [Fact] - public void CorrectPrintToOutTest() - { - var writer = new Mock(); - writer.Setup(x => x.WriteLine(It.IsAny())) - .Verifiable(); - - var vm = new VirtualMachine(new(), new Stack(new[] { new Frame() }), new(), writer.Object); - var print = new Print(0, new Constant(223, "223")); - - print.Execute(vm); - writer.Verify(x => x.WriteLine( - It.Is(v => v!.Equals(223)) - ), Times.Once()); - } - - [Fact] - public void ProgramWithoutHaltWillNotRunTest() - { - var program = new List(); - Assert.Throws(() => _vm.Run(program)); - - program.Add(new Halt(0)); - Assert.Null(Record.Exception(() => _vm.Run(program))); - } - - [Fact] - public void VirtualMachineFramesClearedAfterExecutionTest() - { - var program = new List() - { - new Simple("a", (new Constant(1, "1"), new Constant(2, "2")), "+", 0), - new AsString("b", new Name("a"), 1), - new Halt(2) - }; - - _vm.Run(program); - Assert.Empty(_vm.Frames); - } - - [Fact] - public void VirtualMachineHandlesRecursionTest() - { - var halt = new Mock(12).Trackable(); - var factorial = new FunctionInfo("fact", 1); - var program = new List - { - new Goto(10, 0), - new BeginFunction(1, factorial), - new Simple("_t2", (new Name("n"), new Constant(2, "2")), "<", 2), - new IfNotGoto(new Name("_t2"), 5, 3), - new Return(1, 4, new Name("n")), - new Simple("_t5", (new Name("n"), new Constant(1, "1")), "-", 5), - new PushParameter(6, "n", new Name("_t5")), - new CallFunction(factorial, 7, 1, "f"), - new Simple("_t8", (new Name("n"), new Name("f")), "*", 8), - new Return(1, 9, new Name("_t8")), - new PushParameter(10, "n", new Constant(6, "6")), - new CallFunction(factorial, 11, 1, "fa6"), - halt.Object - }; - - _vm.Run(program); - Assert.Empty(_vm.CallStack); - Assert.Empty(_vm.Arguments); - halt.Verify(x => x.Execute( - It.Is( - vm => Convert.ToInt32(vm.Frames.Peek()["fa6"]) == 720 - ) - ), Times.Once()); - _vm.Frames.Pop(); - } - - [Fact] - public void CreateArrayReservesCertainSpaceTest() - { - var vm = new VirtualMachine(); - vm.Frames.Push(new Frame()); - - var createArray = new CreateArray(0, "arr", 6); - createArray.Execute(vm); - Assert.Equal(6, ((List) vm.Frames.Peek()["arr"]).Count); - - var indexAssignment = new IndexAssignment("arr", (new Constant(0, "0"), new Constant(0, "0")), 1); - indexAssignment.Execute(vm); - Assert.Equal(0, ((List) vm.Frames.Peek()["arr"])[0]); - - var removeFromArray = new RemoveFromArray(2, "arr", new Constant(5, "5")); - removeFromArray.Execute(vm); - Assert.Equal(5, ((List) vm.Frames.Peek()["arr"]).Count); - } - - [Fact] - public void ObjectCreationTest() - { - var halt = new Mock(2).Trackable(); - var program = new List - { - new CreateObject(0, "obj"), - new DotAssignment("obj", (new Constant("prop", "prop"), new Constant(null, "null")), 1), - halt.Object - }; - - _vm.Run(program); - halt.Verify(x => x.Execute( - It.Is( - // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract - vm => ((Dictionary)vm.Frames.Peek()["obj"])["prop"] == null - ) - ), Times.Once()); - _vm.Frames.Pop(); - } -} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/IR/AstNodeTests.cs b/Interpreter.Tests/Unit/IR/AstNodeTests.cs deleted file mode 100644 index 95344cb0..00000000 --- a/Interpreter.Tests/Unit/IR/AstNodeTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes; -using Interpreter.Lib.IR.Ast.Nodes.Declarations; -using Interpreter.Lib.IR.Ast.Nodes.Statements; -using Interpreter.Lib.IR.CheckSemantics.Types; -using Interpreter.Lib.IR.CheckSemantics.Variables.Symbols; -using Moq; -using Xunit; - -namespace Interpreter.Tests.Unit.IR; - -public class AstNodeTests -{ - [Fact] - public void PrecedenceTest() - { - var fType = new Mock(new Mock("").Object, new List()); - var funcSymbol = new FunctionSymbol("f", new List(), fType.Object); - - var lexicalDecl = new LexicalDeclaration(false); - var stmtItemList = new List - { - lexicalDecl - }; - // ReSharper disable once UnusedVariable - var func = new FunctionDeclaration(funcSymbol, new BlockStatement(stmtItemList)); - - Assert.True(lexicalDecl.ChildOf()); - } -} \ No newline at end of file diff --git a/Interpreter.Tests/Unit/IR/ExpressionTests.cs b/Interpreter.Tests/Unit/IR/ExpressionTests.cs deleted file mode 100644 index 30663b57..00000000 --- a/Interpreter.Tests/Unit/IR/ExpressionTests.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Interpreter.Lib.IR.Ast.Nodes.Expressions; -using Interpreter.Lib.IR.Ast.Nodes.Expressions.PrimaryExpressions; -using Xunit; - -namespace Interpreter.Tests.Unit.IR; - -public class ExpressionTests -{ - [Fact] - public void BinaryExpressionTest() - { - var number = new Type("number"); - - var left = new Literal(number, 0); - var right = new Literal(number, 1); - - var binExpr = new BinaryExpression(left, "-", right); - - var ex = Record.Exception(() => binExpr.SemanticCheck()); - Assert.Null(ex); - } -} \ No newline at end of file diff --git a/Interpreter/Services/Providers/ILexerProvider.cs b/Interpreter/Services/Providers/ILexerProvider.cs deleted file mode 100644 index 0f34a033..00000000 --- a/Interpreter/Services/Providers/ILexerProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens; - -namespace Interpreter.Services.Providers; - -public interface ILexerProvider -{ - ILexer CreateLexer(); -} \ No newline at end of file diff --git a/Interpreter/Services/Providers/IParserProvider.cs b/Interpreter/Services/Providers/IParserProvider.cs deleted file mode 100644 index cd7b7101..00000000 --- a/Interpreter/Services/Providers/IParserProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Interpreter.Lib.FrontEnd.TopDownParse; - -namespace Interpreter.Services.Providers; - -public interface IParserProvider -{ - IParser CreateParser(); -} \ No newline at end of file diff --git a/Interpreter/Services/Providers/IStructureProvider.cs b/Interpreter/Services/Providers/IStructureProvider.cs deleted file mode 100644 index 037c97e6..00000000 --- a/Interpreter/Services/Providers/IStructureProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Interpreter.Lib.FrontEnd.GetTokens.Data; - -namespace Interpreter.Services.Providers; - -public interface IStructureProvider -{ - Structure CreateStructure(); -} \ No newline at end of file diff --git a/Readme.md b/Readme.md index de8ec1ab..a204709d 100644 --- a/Readme.md +++ b/Readme.md @@ -2,8 +2,8 @@ Package | Line Rate | Health -------- | --------- | ------ -Interpreter.Lib | 40% | ❌ -Interpreter | 100% | ✔ +HydraScript.Lib | 40% | ❌ +HydraScript | 100% | ✔ **Summary** | **43%** (925 / 2173) | ❌ _Minimum allowed line rate is `80%`_ @@ -14,9 +14,9 @@ _Minimum allowed line rate is `80%`_ За основу был взят стандарт [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) -[Лексическая структура](Interpreter/TokenTypes.cs) +[Лексическая структура](HydraScript/TokenTypes.cs) -[Грамматика](Interpreter/grammar.txt) +[Грамматика](HydraScript/grammar.txt) [Рабочие примеры](samples) @@ -164,7 +164,7 @@ let s = v2d as string - .NET 7 SDK ### Сборка -После клонирования репозитория идём в папку проекта `Interpreter`. +После клонирования репозитория идём в папку проекта `HydraScript`. Там выполняем команду: ```dotnet publish -r -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ``` @@ -174,13 +174,13 @@ let s = v2d as string ### Запуск ``` -Interpreter 1.2.6 -Copyright (C) 2022 Interpreter +HydraScript 1.2.6 +Copyright (C) 2024 HydraScript USAGE: Simple interpretation call: - Interpreter file.js + HydraScript file.js Request dump: - Interpreter --dump file.js + HydraScript --dump file.js -d, --dump (Default: false) Show dump data of interpreter diff --git a/samples/equals.js b/samples/equals.js index c512345e..09724ff7 100644 --- a/samples/equals.js +++ b/samples/equals.js @@ -1,20 +1,17 @@ type withEquals = { prop: number; - equals: (withEquals) => boolean; } -let obj1 = { +function equals(obj: withEquals, that: withEquals) { + return obj.prop == that.prop +} + +let obj1: withEquals = { prop: 1; - equals => (that: withEquals): boolean { - return prop == (that.prop) - }; } -let obj2 = { +let obj2: withEquals = { prop: 2; - equals => (that: withEquals): boolean { - return prop == (that.prop) - }; } let res = obj1.equals(obj2) diff --git a/samples/forwardref.js b/samples/forwardref.js new file mode 100644 index 00000000..5c73092e --- /dev/null +++ b/samples/forwardref.js @@ -0,0 +1,15 @@ +type A = { + b: B; +} + +type B = { + a: A; +} + +let a: A = { + b: { + a: null; + }; +} + +print(a as string) \ No newline at end of file diff --git a/samples/linkedlist.js b/samples/linkedlist.js index 439ff2bf..f3aa7f2f 100644 --- a/samples/linkedlist.js +++ b/samples/linkedlist.js @@ -4,8 +4,27 @@ type node = { } type list = { head: node; - append: (number,) => void; - getOdd: () => number[]; +} + +function append(lst: list, item: number) { + let tail: node = lst.head + while (tail.next != null) { + tail = tail.next + } + tail.next = makeNode(item) +} + +function getOdd(lst: list): number[] { + let result: number[] + let n = lst.head + while (n != null) { + if (n.data % 2 != 0) { + let i = n.data + result = result ++ [i] + } + n = n.next + } + return result } function makeNode(item: number): node { @@ -17,25 +36,6 @@ function makeNode(item: number): node { let linkedList: list = { head: makeNode(1); - append => (item: number) { - let tail: node = head - while ((tail.next) != null) { - tail = tail.next - } - tail.next = makeNode(item) - }; - getOdd => (): number[] { - let result: number[] - let n = head - while (n != null) { - if ((n.data) % 2 != 0) { - let i = n.data - result = result ++ [i,] - } - n = n.next - } - return result - }; } linkedList.append(3) diff --git a/samples/settable.js b/samples/settable.js index f9b94258..0219a6f3 100644 --- a/samples/settable.js +++ b/samples/settable.js @@ -1,16 +1,16 @@ type settable = { prop: string; - setprop: (string) => void; +} + +function setprop(obj: settable, str: string) { + obj.prop = str + if (obj.prop == "1") { + print("prop is one") + } } let obj: settable = { prop: "prop"; - setprop => (str: string) { - prop = str - if (prop == "1") { - print("prop is one") - } - }; } obj.setprop("1") diff --git a/samples/summator.js b/samples/summator.js index 893aee84..029e6803 100644 --- a/samples/summator.js +++ b/samples/summator.js @@ -1,9 +1,15 @@ -let summator = { +type summable{ + x: number; + y: number; +} + +function sum(obj: summable): number { + return obj.x + obj.y +} + +let summator: summable = { x: 1; y: 2; - sum => (): number { - return x + y - }; } let s = summator.sum() diff --git a/samples/this.js b/samples/this.js index 6d577351..5b8a3aea 100644 --- a/samples/this.js +++ b/samples/this.js @@ -1,11 +1,18 @@ -let obj = { +type ObjType = { + num: number; + flag: boolean; + str: string; +} + +function toString(obj: ObjType): string { + let s = "object obj:\n" + return s + (obj as string) +} + +let obj: ObjType = { num: 1; flag: true; str: "field"; - toString => (): string { - let s = "object obj:\n" - return s + (this as string) - }; } print(obj.toString()) \ No newline at end of file diff --git a/samples/typeresolving.js b/samples/typeresolving.js new file mode 100644 index 00000000..19730899 --- /dev/null +++ b/samples/typeresolving.js @@ -0,0 +1,14 @@ +type A = { + a: B; +} +{ + type C = string + type D = number[] + type E = A[] + type R = { + prop: R; +} +} +type B = { + b: A; +} \ No newline at end of file diff --git a/samples/vec2d.js b/samples/vec2d.js index bc20bd18..2086ccea 100644 --- a/samples/vec2d.js +++ b/samples/vec2d.js @@ -18,5 +18,6 @@ function vlensquared(v: vec2d): number { let v = makeVec(3, 4) let l = vlensquared(v) - +print(l as string) +l = v.vlensquared() print(l as string) \ No newline at end of file From 1126b008b6e3a1e91d1dd179efadd094047e7738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sun, 21 Jul 2024 00:12:48 +0300 Subject: [PATCH 02/35] Feature/net 8 (#62) * #50 - .NET 8 * #44 - mac m1 --- .github/workflows/develop.yml | 2 +- .github/workflows/release.yml | 5 ++++- HydraScript.Lib/HydraScript.Lib.csproj | 2 +- HydraScript.Tests/HydraScript.Tests.csproj | 2 +- HydraScript/HydraScript.csproj | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 03815244..e687b628 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -18,7 +18,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Cache NuGet packages uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a2b937e..8469d9ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,9 @@ jobs: - os: macos-latest rid: osx-x64 type: application/x-mach-binary + - os: macos-arm64-latest + rid: osx-arm64 + type: application/x-mach-binary - os: windows-latest rid: win-x64 type: application/x-dosexec @@ -42,7 +45,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Publish run: | mkdir output diff --git a/HydraScript.Lib/HydraScript.Lib.csproj b/HydraScript.Lib/HydraScript.Lib.csproj index c168c6de..a360d3fe 100644 --- a/HydraScript.Lib/HydraScript.Lib.csproj +++ b/HydraScript.Lib/HydraScript.Lib.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 enable diff --git a/HydraScript.Tests/HydraScript.Tests.csproj b/HydraScript.Tests/HydraScript.Tests.csproj index 31970460..ccda5d99 100644 --- a/HydraScript.Tests/HydraScript.Tests.csproj +++ b/HydraScript.Tests/HydraScript.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 false enable diff --git a/HydraScript/HydraScript.csproj b/HydraScript/HydraScript.csproj index 4a9d0b3b..0f591400 100644 --- a/HydraScript/HydraScript.csproj +++ b/HydraScript/HydraScript.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 1.2.6 enable From fb30b93be1d8e011a634a3f4c16791391dee7350 Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 21 Jul 2024 10:58:12 +0300 Subject: [PATCH 03/35] upd Readme.md --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a204709d..08848aa1 100644 --- a/Readme.md +++ b/Readme.md @@ -161,7 +161,7 @@ let s = v2d as string ### Требования -- .NET 7 SDK +- .NET 8 SDK ### Сборка После клонирования репозитория идём в папку проекта `HydraScript`. From 8241e18a5eff10c03a4cd95761a7374b70b538d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sun, 21 Jul 2024 23:39:51 +0300 Subject: [PATCH 04/35] =?UTF-8?q?#32=20-=20CommandLineSettings.cs=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BE=D0=B1=D1=8B=D1=87=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20dto=20=D1=81=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=D0=BC=D0=B8=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HydraScript.Tests/Helpers/MockExtensions.cs | 5 ---- .../Unit/Infrastructure/ExecutorTests.cs | 17 +++++-------- .../Unit/Infrastructure/ProvidersTests.cs | 13 +++++----- HydraScript/CommandLineSettings.cs | 10 ++------ HydraScript/Program.cs | 5 ++++ .../Services/Executor/Impl/Executor.cs | 12 ++++++---- .../LexerProvider/Impl/LexerProvider.cs | 10 ++++++-- .../ParserProvider/Impl/ParserProvider.cs | 10 ++++++-- .../SourceCode/ISourceCodeProvider.cs | 6 +++++ .../SourceCode/Impl/SourceCodeProvider.cs | 24 +++++++++++++++++++ 10 files changed, 74 insertions(+), 38 deletions(-) create mode 100644 HydraScript/Services/SourceCode/ISourceCodeProvider.cs create mode 100644 HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs diff --git a/HydraScript.Tests/Helpers/MockExtensions.cs b/HydraScript.Tests/Helpers/MockExtensions.cs index 31c53040..b854cbeb 100644 --- a/HydraScript.Tests/Helpers/MockExtensions.cs +++ b/HydraScript.Tests/Helpers/MockExtensions.cs @@ -1,7 +1,6 @@ using HydraScript.Lib.BackEnd; using HydraScript.Lib.BackEnd.Addresses; using HydraScript.Lib.BackEnd.Instructions; -using Microsoft.Extensions.Options; using Moq; namespace HydraScript.Tests.Helpers; @@ -16,10 +15,6 @@ public static Mock Trackable(this Mock halt) return halt; } - public static IOptions ToOptions - (this Mock commandLineSettings) => - Options.Create(commandLineSettings.Object); - public static Mock ToInstructionMock(this int number) { var result = new Mock(MockBehavior.Default) diff --git a/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs b/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs index 713ca87e..5626f24e 100644 --- a/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs @@ -5,7 +5,7 @@ using HydraScript.Lib.IR.Ast; using HydraScript.Services.Executor.Impl; using HydraScript.Services.Parsing; -using HydraScript.Tests.Helpers; +using HydraScript.Services.SourceCode; using HydraScript.Tests.Stubs; using Moq; using Xunit; @@ -14,15 +14,10 @@ namespace HydraScript.Tests.Unit.Infrastructure; public class ExecutorTests { - private readonly Mock _settings; private readonly Mock _parsingService; public ExecutorTests() { - _settings = new Mock(); - _settings.Setup(x => x.Dump).Returns(false); - _settings.Setup(x => x.InputFilePath).Returns("file.js"); - _parsingService = new Mock(); } @@ -36,7 +31,7 @@ public void ExecuteGoesOkTest() _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, _settings.ToOptions()); + var executor = new Executor(_parsingService.Object, Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } @@ -50,7 +45,7 @@ public void SemanticExceptionCaughtTest() _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, _settings.ToOptions()); + var executor = new Executor(_parsingService.Object, Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } @@ -60,7 +55,7 @@ public void LexerExceptionCaughtTest() _parsingService.Setup(x => x.Parse(It.IsAny())) .Throws(); - var executor = new Executor(_parsingService.Object, _settings.ToOptions()); + var executor = new Executor(_parsingService.Object, Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } @@ -70,7 +65,7 @@ public void ParserExceptionCaughtTest() _parsingService.Setup(x => x.Parse(It.IsAny())) .Throws(); - var executor = new Executor(_parsingService.Object, _settings.ToOptions()); + var executor = new Executor(_parsingService.Object, Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } @@ -88,7 +83,7 @@ public void InternalInterpreterErrorCaughtTest() _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, _settings.ToOptions()); + var executor = new Executor(_parsingService.Object, Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } } \ No newline at end of file diff --git a/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs index 8a3e14a2..e0e40edc 100644 --- a/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs @@ -1,3 +1,4 @@ +using System.IO.Abstractions; using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; @@ -32,13 +33,13 @@ public void CertainLexerProvidedTest(SystemType lexerType, bool dump) Dump = dump, InputFilePath = "file.js" }); - - var lexerProvider = new LexerProvider(structureProvider.Object, options.Object); + + var lexerProvider = new LexerProvider(structureProvider.Object, Mock.Of(), options.Object); var lexer = lexerProvider.CreateLexer(); - + Assert.IsType(lexerType, lexer); } - + [Theory] [InlineData(typeof(Parser), false)] [InlineData(typeof(LoggingParser), true)] @@ -57,9 +58,9 @@ public void CertainParserProvidedTest(SystemType parserType, bool dump) lexerProvider.Setup(x => x.CreateLexer()) .Returns(lexer.Object); - var parserProvider = new ParserProvider(lexerProvider.Object, options.Object); + var parserProvider = new ParserProvider(lexerProvider.Object, Mock.Of(), options.Object); var parser = parserProvider.CreateParser(); - + Assert.IsType(parserType, parser); } } \ No newline at end of file diff --git a/HydraScript/CommandLineSettings.cs b/HydraScript/CommandLineSettings.cs index 3d9e4c2e..f51a63d4 100644 --- a/HydraScript/CommandLineSettings.cs +++ b/HydraScript/CommandLineSettings.cs @@ -11,10 +11,10 @@ namespace HydraScript; public class CommandLineSettings { [Value(0, MetaName = "InputFilePath", Required = true, HelpText = "Path to input file")] - public virtual string InputFilePath { get; set; } + public string InputFilePath { get; set; } [Option('d', "dump", Default = false, HelpText = "Show dump data of interpreter")] - public virtual bool Dump { get; set; } + public bool Dump { get; set; } [Usage(ApplicationAlias = "HydraScript")] public static IEnumerable Examples @@ -27,10 +27,4 @@ public static IEnumerable Examples new CommandLineSettings { InputFilePath = "file.js", Dump = true }); } } - - public string GetInputFileName() => - InputFilePath.Split(".js")[0]; - - public virtual string GetText() => - File.ReadAllText(InputFilePath); } \ No newline at end of file diff --git a/HydraScript/Program.cs b/HydraScript/Program.cs index bf58d911..fc56feb3 100644 --- a/HydraScript/Program.cs +++ b/HydraScript/Program.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using System.IO.Abstractions; using CommandLine; using HydraScript.Services.Executor; using HydraScript.Services.Executor.Impl; @@ -10,6 +11,8 @@ using HydraScript.Services.Providers.ParserProvider.Impl; using HydraScript.Services.Providers.StructureProvider; using HydraScript.Services.Providers.StructureProvider.Impl; +using HydraScript.Services.SourceCode; +using HydraScript.Services.SourceCode.Impl; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; @@ -39,6 +42,8 @@ private static void ConfigureServices(CommandLineSettings settings) ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); + ServiceCollection.AddSingleton(); + ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); diff --git a/HydraScript/Services/Executor/Impl/Executor.cs b/HydraScript/Services/Executor/Impl/Executor.cs index 738ee018..df773642 100644 --- a/HydraScript/Services/Executor/Impl/Executor.cs +++ b/HydraScript/Services/Executor/Impl/Executor.cs @@ -3,6 +3,7 @@ using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.TopDownParse; using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Services.SourceCode; using Microsoft.Extensions.Options; namespace HydraScript.Services.Executor.Impl; @@ -10,19 +11,22 @@ namespace HydraScript.Services.Executor.Impl; public class Executor : IExecutor { private readonly IParsingService _parsingService; - private readonly CommandLineSettings _commandLineSettings; + private readonly ISourceCodeProvider _sourceCodeProvider; - public Executor(IParsingService parsingService, IOptions options) + public Executor( + IParsingService parsingService, + ISourceCodeProvider sourceCodeProvider) { _parsingService = parsingService; - _commandLineSettings = options.Value; + _sourceCodeProvider = sourceCodeProvider; } public void Execute() { try { - var ast = _parsingService.Parse(_commandLineSettings.GetText()); + var text = _sourceCodeProvider.GetText(); + var ast = _parsingService.Parse(text); var instructions = ast.GetInstructions(); var vm = new VirtualMachine(); diff --git a/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs index 7ac47e3e..d1678e85 100644 --- a/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs +++ b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs @@ -9,11 +9,16 @@ namespace HydraScript.Services.Providers.LexerProvider.Impl; public class LexerProvider : ILexerProvider { private readonly IStructureProvider _structureProvider; + private readonly IFileSystem _fileSystem; private readonly CommandLineSettings _settings; - public LexerProvider(IStructureProvider structureProvider, IOptions options) + public LexerProvider( + IStructureProvider structureProvider, + IFileSystem fileSystem, + IOptions options) { _structureProvider = structureProvider; + _fileSystem = fileSystem; _settings = options.Value; } @@ -21,8 +26,9 @@ public ILexer CreateLexer() { var structure = _structureProvider.CreateStructure(); var lexer = new Lexer(structure); + var inputFileName = _settings.InputFilePath.Split(".js")[0]; return _settings.Dump - ? new LoggingLexer(lexer, _settings.GetInputFileName(), new FileSystem()) + ? new LoggingLexer(lexer, inputFileName, _fileSystem) : lexer; } } \ No newline at end of file diff --git a/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs b/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs index 924c9d79..8516fde8 100644 --- a/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs +++ b/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs @@ -9,11 +9,16 @@ namespace HydraScript.Services.Providers.ParserProvider.Impl; public class ParserProvider : IParserProvider { private readonly ILexerProvider _lexerProvider; + private readonly IFileSystem _fileSystem; private readonly CommandLineSettings _settings; - public ParserProvider(ILexerProvider lexerProvider, IOptions options) + public ParserProvider( + ILexerProvider lexerProvider, + IFileSystem fileSystem, + IOptions options) { _lexerProvider = lexerProvider; + _fileSystem = fileSystem; _settings = options.Value; } @@ -21,8 +26,9 @@ public IParser CreateParser() { var lexer = _lexerProvider.CreateLexer(); var parser = new Parser(lexer); + var inputFileName = _settings.InputFilePath.Split(".js")[0]; return _settings.Dump - ? new LoggingParser(parser, _settings.GetInputFileName(), new FileSystem()) + ? new LoggingParser(parser, inputFileName, _fileSystem) : parser; } } \ No newline at end of file diff --git a/HydraScript/Services/SourceCode/ISourceCodeProvider.cs b/HydraScript/Services/SourceCode/ISourceCodeProvider.cs new file mode 100644 index 00000000..a6effc9a --- /dev/null +++ b/HydraScript/Services/SourceCode/ISourceCodeProvider.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Services.SourceCode; + +public interface ISourceCodeProvider +{ + string GetText(); +} \ No newline at end of file diff --git a/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs b/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs new file mode 100644 index 00000000..d4f63d3f --- /dev/null +++ b/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs @@ -0,0 +1,24 @@ +using System.IO.Abstractions; +using Microsoft.Extensions.Options; + +namespace HydraScript.Services.SourceCode.Impl; + +internal class SourceCodeProvider : ISourceCodeProvider +{ + private readonly IFileSystem _fileSystem; + private readonly CommandLineSettings _commandLineSettings; + + public SourceCodeProvider( + IFileSystem fileSystem, + IOptions commandLineSettings) + { + _fileSystem = fileSystem; + _commandLineSettings = commandLineSettings.Value; + } + + public string GetText() + { + var inputFilePath = _commandLineSettings.InputFilePath; + return _fileSystem.File.ReadAllText(inputFilePath); + } +} \ No newline at end of file From 2750118a30e594ee9a29479de21c51623551b0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Wed, 24 Jul 2024 20:45:11 +0300 Subject: [PATCH 05/35] =?UTF-8?q?Update=20develop.yml=20-=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=BA=D0=B8=D0=BD=D1=83=D0=BB=20=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index e687b628..499c3de9 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -8,6 +8,13 @@ on: branches: - '**' +permissions: + actions: write + checks: write + contents: write + issues: write + pull-requests: write + jobs: build-and-test: name: Build & Test From f6f068a5fe3020e9831ed09ac035709ef6d8c409 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Thu, 25 Jul 2024 17:47:32 +0300 Subject: [PATCH 06/35] Add unique Guid check to HashAddress.Equals (#65) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add unique Guid check to HashAddress.Equals * Update develop.yml - накинул фиксированных permissions --------- Co-authored-by: Степан --- .../BackEnd/Addresses/HashAddress.cs | 4 ++- .../Unit/BackEnd/HashAddressTests.cs | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs diff --git a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs index a83ef24e..88302f3a 100644 --- a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs +++ b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs @@ -3,6 +3,8 @@ namespace HydraScript.Lib.BackEnd.Addresses; public class HashAddress : IAddress { private readonly int _seed; + + private readonly Guid _id = Guid.NewGuid(); public IAddress Next { get; set; } @@ -12,7 +14,7 @@ public HashAddress(int seed) => public bool Equals(IAddress other) { if (other is HashAddress hashed) - return _seed == hashed._seed; + return _seed == hashed._seed && _id == hashed._id; return false; } diff --git a/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs b/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs new file mode 100644 index 00000000..57691c72 --- /dev/null +++ b/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs @@ -0,0 +1,35 @@ +using HydraScript.Lib.BackEnd.Addresses; +using Xunit; + +namespace HydraScript.Tests.Unit.BackEnd; + +public class HashAddressTests +{ + [Fact] + public void EqualsReturnsFalseForTwoDifferentObjectsWithSameSeed() + { + const int seed = 1; + + var addressOne = new HashAddress(seed); + var addressTwo = new HashAddress(seed); + + Assert.NotEqual(addressOne, addressTwo); + } + + [Fact] + public void EqualsReturnsTrueForTwoSameOjectsWithSameSeed() + { + var address = new HashAddress(1); + + Assert.Equal(address, address); + } + + [Fact] + public void EqualsReturnsFalseForTwoObjectsWithDifferentSeed() + { + var addressOne = new HashAddress(0); + var addressTwo = new HashAddress(1); + + Assert.NotEqual(addressOne, addressTwo); + } +} \ No newline at end of file From 325b5e55851fd047f9197e9304d3c31ac5dfebbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Thu, 25 Jul 2024 19:57:04 +0300 Subject: [PATCH 07/35] Update develop.yml --- .github/workflows/develop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 499c3de9..b899ca50 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -4,7 +4,7 @@ on: push: branches: - '**' - pull_request: + pull_request_target: branches: - '**' @@ -40,7 +40,7 @@ jobs: dotnet test -c Release --no-build -v n --filter="Category=Unit" mkdir coverage-report - name: Code Coverage Summary Report For Merge Request - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' uses: 5monkeys/cobertura-action@master with: path: ./HydraScript.Tests/coverage.cobertura.xml From b239f047b39bf833d74b723efa4ff23c65da797c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Thu, 25 Jul 2024 20:32:39 +0300 Subject: [PATCH 08/35] Feature/nrt (#66) * #46 - nrt 1 * #46 - nrt 2 * #46 - nrt 3 * #46 - after merge * #46 - fix --- .../BackEnd/AddressedInstructions.cs | 8 +- .../BackEnd/Addresses/HashAddress.cs | 11 +-- HydraScript.Lib/BackEnd/Addresses/Label.cs | 19 ++--- .../BackEnd/Instructions/Instruction.cs | 2 +- .../BackEnd/Instructions/PushParameter.cs | 12 +-- .../BackEnd/Instructions/RemoveFromArray.cs | 16 ++-- .../BackEnd/Instructions/Return.cs | 13 +--- .../Instructions/WithAssignment/AsString.cs | 9 +-- .../WithAssignment/CallFunction.cs | 2 +- .../ComplexData/Create/CreateArray.cs | 12 +-- .../ComplexData/Create/CreateObject.cs | 7 +- .../ComplexData/Read/DotRead.cs | 23 ++---- .../ComplexData/Read/IndexRead.cs | 21 ++---- .../ComplexData/Write/DotAssignment.cs | 17 +++-- .../ComplexData/Write/IndexAssignment.cs | 17 +++-- .../Instructions/WithAssignment/Simple.cs | 28 +++---- .../BackEnd/Instructions/WithJump/Goto.cs | 2 +- HydraScript.Lib/BackEnd/Values/Constant.cs | 29 +++---- HydraScript.Lib/BackEnd/Values/IValue.cs | 2 +- HydraScript.Lib/BackEnd/Values/Name.cs | 23 ++---- HydraScript.Lib/BackEnd/VirtualMachine.cs | 26 +++---- .../FrontEnd/GetTokens/Data/Token.cs | 22 +++--- .../Data/TokenTypes/IgnorableType.cs | 2 +- .../FrontEnd/GetTokens/Impl/Lexer.cs | 12 +-- .../FrontEnd/TopDownParse/Impl/Parser.cs | 34 ++++----- .../FrontEnd/TopDownParse/ParserException.cs | 2 +- HydraScript.Lib/HydraScript.Lib.csproj | 2 + .../IR/Ast/AbstractSyntaxTreeNode.cs | 13 ++-- .../FunctionDeclaration.cs | 2 +- .../AccessExpressions/AccessExpression.cs | 8 +- .../AccessExpressions/DotAccess.cs | 4 +- .../AccessExpressions/IndexAccess.cs | 4 +- .../Nodes/Expressions/AssignmentExpression.cs | 4 +- .../Expressions/ComplexLiterals/Property.cs | 2 +- .../Nodes/Expressions/MemberExpression.cs | 14 ++-- .../PrimaryExpressions/IdentifierReference.cs | 9 +-- .../PrimaryExpressions/ImplicitLiteral.cs | 11 +-- .../Expressions/PrimaryExpressions/Literal.cs | 10 +-- .../Ast/Impl/Nodes/Statements/IfStatement.cs | 4 +- .../Impl/Nodes/Statements/ReturnStatement.cs | 6 +- .../Visitors/ExpressionInstructionProvider.cs | 75 ++++++++----------- .../IR/Ast/Visitors/InstructionProvider.cs | 18 ++--- .../IR/CheckSemantics/Types/Any.cs | 8 +- .../IR/CheckSemantics/Types/ArrayType.cs | 16 ++-- .../IR/CheckSemantics/Types/NullType.cs | 8 +- .../IR/CheckSemantics/Types/NullableType.cs | 8 +- .../IR/CheckSemantics/Types/ObjectType.cs | 20 ++--- .../IR/CheckSemantics/Types/Type.cs | 8 +- .../CheckSemantics/Variables/SymbolTable.cs | 6 +- .../Variables/Symbols/FunctionSymbol.cs | 31 +++----- .../Variables/Symbols/ObjectSymbol.cs | 11 +-- .../Variables/Symbols/TypeSymbol.cs | 14 +--- .../Variables/Symbols/VariableSymbol.cs | 15 +--- .../Visitors/DeclarationVisitor.cs | 2 +- .../Visitors/SemanticChecker.cs | 12 +-- .../IDefaultValueForTypeCalculator.cs | 2 +- .../Impl/DefaultValueForTypeCalculator.cs | 2 +- .../Impl/SymbolTableInitializerService.cs | 4 +- .../Services/Impl/TypeDeclarationsResolver.cs | 4 +- HydraScript.Tests/HydraScript.Tests.csproj | 2 + HydraScript.Tests/Unit/BackEnd/CallTests.cs | 10 +-- .../Unit/BackEnd/InstructionsTests.cs | 2 +- .../Unit/BackEnd/VirtualMachineTests.cs | 9 +-- .../Unit/IR/Types/ObjectTypeTests.cs | 2 +- HydraScript/CommandLineSettings.cs | 2 +- HydraScript/HydraScript.csproj | 2 + HydraScript/Program.cs | 4 +- .../Impl/StructureProvider.cs | 6 +- samples/summator.js | 2 +- 69 files changed, 320 insertions(+), 449 deletions(-) diff --git a/HydraScript.Lib/BackEnd/AddressedInstructions.cs b/HydraScript.Lib/BackEnd/AddressedInstructions.cs index 62c4d6fe..42d36845 100644 --- a/HydraScript.Lib/BackEnd/AddressedInstructions.cs +++ b/HydraScript.Lib/BackEnd/AddressedInstructions.cs @@ -17,12 +17,12 @@ public Instruction this[IAddress address] } public IAddress Start => - _addresses.First?.Value; + _addresses.First?.Value!; public IAddress End => - _addresses.Last?.Value; + _addresses.Last?.Value!; - public void Add(Instruction instruction, string label = null) + public void Add(Instruction instruction, string? label = null) { IAddress newAddress = label is null ? new HashAddress(seed: instruction.GetHashCode()) @@ -66,7 +66,7 @@ public void Remove(Instruction instruction) var prev = nodeToRemove.Previous; if (prev is not null) { - prev.Value.Next = nodeToRemove.Next?.Value; + prev.Value.Next = nodeToRemove.Next?.Value!; } _addressToNode.Remove(address); diff --git a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs index 88302f3a..a2e6f701 100644 --- a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs +++ b/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs @@ -1,17 +1,14 @@ namespace HydraScript.Lib.BackEnd.Addresses; -public class HashAddress : IAddress +public class HashAddress(int seed) : IAddress { - private readonly int _seed; + private readonly int _seed = seed; private readonly Guid _id = Guid.NewGuid(); - - public IAddress Next { get; set; } - public HashAddress(int seed) => - _seed = seed; + public IAddress Next { get; set; } = default!; - public bool Equals(IAddress other) + public bool Equals(IAddress? other) { if (other is HashAddress hashed) return _seed == hashed._seed && _id == hashed._id; diff --git a/HydraScript.Lib/BackEnd/Addresses/Label.cs b/HydraScript.Lib/BackEnd/Addresses/Label.cs index ae41adde..912d7cfe 100644 --- a/HydraScript.Lib/BackEnd/Addresses/Label.cs +++ b/HydraScript.Lib/BackEnd/Addresses/Label.cs @@ -1,21 +1,14 @@ namespace HydraScript.Lib.BackEnd.Addresses; -public class Label : IAddress +public class Label(string name) : IAddress { - public string Name { get; } + public string Name { get; } = name; - public Label(string name) => - Name = name; - - public IAddress Next { get; set; } + public IAddress Next { get; set; } = default!; - public bool Equals(IAddress other) - { - if (other is Label label) - return Name == label.Name; - - return false; - } + public bool Equals(IAddress? other) => + other is Label label && + Name == label.Name; public override int GetHashCode() => Name.GetHashCode(); diff --git a/HydraScript.Lib/BackEnd/Instructions/Instruction.cs b/HydraScript.Lib/BackEnd/Instructions/Instruction.cs index e57bdd7b..fb8931a8 100644 --- a/HydraScript.Lib/BackEnd/Instructions/Instruction.cs +++ b/HydraScript.Lib/BackEnd/Instructions/Instruction.cs @@ -4,7 +4,7 @@ namespace HydraScript.Lib.BackEnd.Instructions; public abstract class Instruction { - private IAddress _address; + private IAddress _address = default!; public IAddress Address { diff --git a/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs b/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs index 0d81cce0..ae3125b1 100644 --- a/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs +++ b/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs @@ -3,20 +3,14 @@ namespace HydraScript.Lib.BackEnd.Instructions; -public class PushParameter : Instruction +public class PushParameter(string parameter, IValue value) : Instruction { - private readonly string _parameter; - private readonly IValue _value; - - public PushParameter(string parameter, IValue value) => - (_parameter, _value) = (parameter, value); - public override IAddress Execute(VirtualMachine vm) { - vm.Arguments.Push((_parameter, _value.Get(vm.Frames.Peek()))); + vm.Arguments.Push((parameter, value.Get(vm.Frames.Peek()))); return Address.Next; } protected override string ToStringInternal() => - $"PushParameter {_parameter} = {_value}"; + $"PushParameter {parameter} = {value}"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs b/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs index 0883f60a..ad0f3ec5 100644 --- a/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs +++ b/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs @@ -3,22 +3,18 @@ namespace HydraScript.Lib.BackEnd.Instructions; -public class RemoveFromArray : Instruction +public class RemoveFromArray(string id, IValue index) : Instruction { - private readonly string _id; - private readonly IValue _index; - - public RemoveFromArray(string id, IValue index) => - (_id, _index) = (id, index); - public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); - var list = (List) frame[_id]; - list.RemoveAt(Convert.ToInt32(_index.Get(frame))); + if (frame[id] is List list) + { + list.RemoveAt(Convert.ToInt32(index.Get(frame))); + } return Address.Next; } protected override string ToStringInternal() => - $"RemoveFrom {_id} at {_index}"; + $"RemoveFrom {id} at {index}"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/Return.cs b/HydraScript.Lib/BackEnd/Instructions/Return.cs index 352ea780..a9afaea5 100644 --- a/HydraScript.Lib/BackEnd/Instructions/Return.cs +++ b/HydraScript.Lib/BackEnd/Instructions/Return.cs @@ -3,25 +3,20 @@ namespace HydraScript.Lib.BackEnd.Instructions; -public class Return : Instruction +public class Return(IValue? value = null) : Instruction { - private readonly IValue _value; - - public Return(IValue value = null) => - _value = value; - public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Pop(); var call = vm.CallStack.Pop(); - if (call.Where != null && _value != null) + if (call.Where != null && value != null) { - vm.Frames.Peek()[call.Where] = _value.Get(frame); + vm.Frames.Peek()[call.Where] = value.Get(frame); } return frame.ReturnAddress; } protected override string ToStringInternal() => - $"Return{(_value != null ? $" {_value}" : "")}"; + $"Return{(value != null ? $" {value}" : "")}"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs index 1a894e37..83db00e3 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs @@ -5,16 +5,13 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; -public class AsString : Simple +public class AsString(IValue value) : Simple(value) { - public AsString(IValue value) : - base(value) { } - public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); - frame[Left] = JsonSerializer.Serialize( - Right.right.Get(frame), + frame[Left!] = JsonSerializer.Serialize( + Right.right!.Get(frame), new JsonSerializerOptions { WriteIndented = true, diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs index 93bfe383..03e2ab61 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs @@ -30,7 +30,7 @@ public override IAddress Execute(VirtualMachine vm) var frame = new Frame(Address.Next, vm.Frames.Peek()); var i = 0; - var args = new List<(string Id, object Value)>(); + var args = new List<(string Id, object? Value)>(); while (i < _numberOfArguments) { args.Add(vm.Arguments.Pop()); diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs index 66df229b..edba4ace 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs @@ -2,21 +2,17 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; -public class CreateArray : Simple +public class CreateArray(string id, int size) : Simple(id) { - private readonly string _id; - private readonly int _size; - - public CreateArray(string id, int size) : base(id) => - (_id, _size) = (id, size); + private readonly string _id = id; public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); - frame[_id] = new object[_size].ToList(); + frame[_id] = new object[size].ToList(); return Address.Next; } protected override string ToStringInternal() => - $"array {_id} = [{_size}]"; + $"array {_id} = [{size}]"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs index 71d5228b..913aafb5 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs @@ -2,12 +2,9 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; -public class CreateObject : Simple +public class CreateObject(string id) : Simple(id) { - private readonly string _id; - - public CreateObject(string id) : base(id) => - _id = id; + private readonly string _id = id; public override IAddress Execute(VirtualMachine vm) { diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs index ffac8bac..18d906a4 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs @@ -3,27 +3,20 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; -public class DotRead : Simple, IReadFromComplexData +public class DotRead(Name @object, IValue property) : Simple( + leftValue: @object, + binaryOperator: ".", + rightValue: property), IReadFromComplexData { - private readonly Name _objectName; - private readonly IValue _property; + private readonly IValue _property = property; - public string Property => (string)_property.Get(frame: null); - - public DotRead(Name @object, IValue property) : base( - leftValue: @object, - binaryOperator: ".", - rightValue: property) - { - _objectName = @object; - _property = property; - } + public string Property => (string)_property.Get(frame: null)!; public Simple ToAssignment(IValue value) => - new DotAssignment(_objectName.ToString(), _property, value); + new DotAssignment(@object.ToString(), _property, value); public Instruction ToInstruction() => this; protected override string ToStringInternal() => - $"{Left} = {_objectName}.{_property}"; + $"{Left} = {@object}.{_property}"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs index 6f249726..b0ac6c81 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs @@ -3,25 +3,18 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; -public class IndexRead : Simple, IReadFromComplexData +public class IndexRead(Name array, IValue index) : Simple( + leftValue: array, + binaryOperator: "[]", + rightValue: index), IReadFromComplexData { - private readonly Name _arrayName; - private readonly IValue _index; - - public IndexRead(Name array, IValue index) : base( - leftValue: array, - binaryOperator: "[]", - rightValue: index) - { - _arrayName = array; - _index = index; - } + private readonly IValue _index = index; public Simple ToAssignment(IValue value) => - new IndexAssignment(_arrayName.ToString(), _index, value); + new IndexAssignment(array.ToString(), _index, value); public Instruction ToInstruction() => this; protected override string ToStringInternal() => - $"{Left} = {_arrayName}[{_index}]"; + $"{Left} = {array}[{_index}]"; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs index de404640..aa9e303a 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs @@ -4,22 +4,23 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -public class DotAssignment : Simple, IWriteToComplexData +public class DotAssignment(string @object, IValue property, IValue value) + : Simple(left: @object, (property, value), "."), IWriteToComplexData { - public DotAssignment(string @object, IValue property, IValue value) : - base(left: @object, (property, value), ".") { } - public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); - var obj = (Dictionary) frame[Left]; - var field = (string) Right.left.Get(frame) ?? string.Empty; - obj[field] = Right.right.Get(frame); + if (frame[Left!] is Dictionary obj) + { + var field = (string?)Right.left?.Get(frame) ?? string.Empty; + obj[field] = Right.right!.Get(frame)!; + } + return Address.Next; } public Simple ToSimple() => - new DotRead(new Name(Left), Right.left); + new DotRead(new Name(Left!), Right.left!); protected override string ToStringInternal() => $"{Left}.{Right.left} = {Right.right}"; diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs index f8acb620..c2b6d561 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs @@ -4,22 +4,23 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -public class IndexAssignment : Simple, IWriteToComplexData +public class IndexAssignment(string array, IValue index, IValue value) + : Simple(left: array, right: (index, value), "[]"), IWriteToComplexData { - public IndexAssignment(string array, IValue index, IValue value) : - base(left: array, right: (index, value), "[]") { } - public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); - var obj = (List) frame[Left]; - var index = Convert.ToInt32(Right.left.Get(frame)); - obj[index] = Right.right.Get(frame); + if (frame[Left!] is List list) + { + var index = Convert.ToInt32(Right.left!.Get(frame)); + list[index] = Right.right!.Get(frame)!; + } + return Address.Next; } public Simple ToSimple() => - new IndexRead(new Name(Left), Right.left); + new IndexRead(new Name(Left!), Right.left!); protected override string ToStringInternal() => $"{Left}[{Right.left}] = {Right.right}"; diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs index fd1ae75b..3a280282 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs @@ -5,16 +5,16 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; public class Simple : Instruction { - public string Left { get; set; } + public string? Left { get; set; } - protected readonly (IValue left, IValue right) Right; - private readonly string _operator; + protected readonly (IValue? left, IValue? right) Right; + private readonly string _operator = string.Empty; - protected Simple(string left) => Left = left; + protected Simple(string? left) => Left = left; public Simple( - string left, - (IValue left, IValue right) right, + string? left, + (IValue? left, IValue? right) right, string @operator) { Left = left; @@ -55,20 +55,20 @@ public override IAddress Execute(VirtualMachine vm) var frame = vm.Frames.Peek(); if (Right.left == null) { - var value = Right.right.Get(frame); - frame[Left] = _operator switch + var value = Right.right!.Get(frame); + frame[Left!] = _operator switch { "-" => -Convert.ToDouble(value), "!" => !Convert.ToBoolean(value), - "~" => ((List)value).Count, + "~" => ((List)value!).Count, "" => value, _ => throw new NotSupportedException($"_operator {_operator} is not supported") }; } else { - object lValue = Right.left.Get(frame), rValue = Right.right.Get(frame); - frame[Left] = _operator switch + object? lValue = Right.left.Get(frame), rValue = Right.right!.Get(frame); + frame[Left!] = _operator switch { "+" when lValue is string => lValue.ToString() + rValue, "+" => Convert.ToDouble(lValue) + Convert.ToDouble(rValue), @@ -84,9 +84,9 @@ public override IAddress Execute(VirtualMachine vm) ">=" => Convert.ToDouble(lValue) >= Convert.ToDouble(rValue), "<" => Convert.ToDouble(lValue) < Convert.ToDouble(rValue), "<=" => Convert.ToDouble(lValue) <= Convert.ToDouble(rValue), - "." => ((Dictionary)lValue)[rValue.ToString()!], - "[]" => ((List)lValue)[Convert.ToInt32(rValue)], - "++" => ((List)lValue).Concat((List)rValue).ToList(), + "." => ((Dictionary)lValue!)[rValue!.ToString()!], + "[]" => ((List)lValue!)[Convert.ToInt32(rValue)], + "++" => ((List)lValue!).Concat((List)rValue!).ToList(), _ => throw new NotSupportedException($"_operator {_operator} is not supported") }; } diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs index 78537886..0611adc1 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs @@ -4,7 +4,7 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithJump; public class Goto : Instruction { - protected Label jump; + protected Label jump = default!; public InsideStatementJumpType? JumpType { get; } diff --git a/HydraScript.Lib/BackEnd/Values/Constant.cs b/HydraScript.Lib/BackEnd/Values/Constant.cs index f89fb9a1..1ba5b4c0 100644 --- a/HydraScript.Lib/BackEnd/Values/Constant.cs +++ b/HydraScript.Lib/BackEnd/Values/Constant.cs @@ -1,30 +1,19 @@ namespace HydraScript.Lib.BackEnd.Values; -public class Constant : IValue +public class Constant(object? value, string representation) : IValue { - private readonly object _value; - private readonly string _representation; + private readonly object? _value = value; - public Constant(object value, string representation) + public Constant(object value) : + this(value, representation: value.ToString()!) { - _value = value; - _representation = representation; } - public Constant(object value) : - this(value, value.ToString()) { } - - public object Get(Frame frame) => _value; + public object? Get(Frame? frame) => _value; - public override string ToString() => _representation; + public override string ToString() => representation; - public bool Equals(IValue other) - { - if (other is Constant that) - { - return Equals(_value, that._value); - } - - return false; - } + public bool Equals(IValue? other) => + other is Constant that && + Equals(_value, that._value); } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Values/IValue.cs b/HydraScript.Lib/BackEnd/Values/IValue.cs index 15fd3c21..ecafaf32 100644 --- a/HydraScript.Lib/BackEnd/Values/IValue.cs +++ b/HydraScript.Lib/BackEnd/Values/IValue.cs @@ -2,5 +2,5 @@ namespace HydraScript.Lib.BackEnd.Values; public interface IValue : IEquatable { - object Get(Frame frame); + object? Get(Frame? frame); } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/Values/Name.cs b/HydraScript.Lib/BackEnd/Values/Name.cs index ba6ad82d..570641d0 100644 --- a/HydraScript.Lib/BackEnd/Values/Name.cs +++ b/HydraScript.Lib/BackEnd/Values/Name.cs @@ -1,25 +1,14 @@ namespace HydraScript.Lib.BackEnd.Values; -public class Name : IValue +public class Name(string id) : IValue { - private readonly string _id; + private readonly string _id = id; - public Name(string id) - { - _id = id; - } - - public object Get(Frame frame) => frame[_id]; + public object? Get(Frame? frame) => frame![_id]; public override string ToString() => _id; - - public bool Equals(IValue other) - { - if (other is Name that) - { - return _id == that._id; - } - return false; - } + public bool Equals(IValue? other) => + other is Name that && + _id == that._id; } \ No newline at end of file diff --git a/HydraScript.Lib/BackEnd/VirtualMachine.cs b/HydraScript.Lib/BackEnd/VirtualMachine.cs index 95796bcf..020191f4 100644 --- a/HydraScript.Lib/BackEnd/VirtualMachine.cs +++ b/HydraScript.Lib/BackEnd/VirtualMachine.cs @@ -4,7 +4,7 @@ namespace HydraScript.Lib.BackEnd; public record VirtualMachine( Stack CallStack, Stack Frames, - Stack<(string Id, object Value)> Arguments, + Stack<(string Id, object? Value)> Arguments, TextWriter Writer ) { @@ -26,16 +26,16 @@ public void Run(AddressedInstructions instructions) instructions[address].Execute(this); } } - + public record Call( IAddress From, FunctionInfo To, - List<(string Id, object Value)> Parameters, - string Where = null) + List<(string Id, object? Value)> Parameters, + string? Where = null) { public override string ToString() => $"{From} => {To.Start}: {To.Id}({string.Join(", ", Parameters.Select(x => $"{x.Id}: {x.Value}"))})"; } - + public record FunctionInfo(string Id) { public Label Start => @@ -46,22 +46,18 @@ public record FunctionInfo(string Id) public override string ToString() => Id; } - -public class Frame -{ - private readonly Dictionary _variables = new(); - private readonly Frame _parentFrame; - public IAddress ReturnAddress { get; } +public class Frame(IAddress returnAddress, Frame? parentFrame = null) +{ + private readonly Dictionary _variables = new(); - public Frame(IAddress returnAddress, Frame parentFrame = null) => - (ReturnAddress, _parentFrame) = (returnAddress, parentFrame); + public IAddress ReturnAddress { get; } = returnAddress; - public object this[string id] + public object? this[string id] { get => _variables.TryGetValue(id, out var value) ? value - : _parentFrame?[id]; + : parentFrame?[id]; set => _variables[id] = value; } } \ No newline at end of file diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs index 6906132f..4c1112e1 100644 --- a/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs @@ -5,23 +5,23 @@ namespace HydraScript.Lib.FrontEnd.GetTokens.Data; [ExcludeFromCodeCoverage] -public record Token(TokenType Type) +public partial record Token(TokenType Type, Segment Segment, string Value) { - public Segment Segment { get; } - - public string Value { get; } - - public Token(TokenType type, Segment segment, string value) : - this(type) => - (Segment, Value) = (segment, value); - public override string ToString() { - var displayValue = Value; - if (displayValue != null) displayValue = Regex.Replace(Value, "\"", "\\\""); + var displayValue = Quotes().Replace(Value, "\\\""); + if (Type.CanIgnore()) displayValue = ""; return $"{Type} {Segment}: {displayValue}"; } + + [GeneratedRegex("\"")] + private static partial Regex Quotes(); +} + +public record EndToken() : Token(new EndOfProgramType(), null!, null!) +{ + public override string ToString() => Type.ToString(); } [ExcludeFromCodeCoverage] diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs index 20532502..8df56f2e 100644 --- a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs @@ -1,6 +1,6 @@ namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -public record IgnorableType(string Tag = null, string Pattern = null, int Priority = 0) +public record IgnorableType(string Tag, string Pattern, int Priority) : TokenType(Tag, Pattern, Priority) { public override bool CanIgnore() => true; diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs index 6e0dbc1c..d86e4ef7 100644 --- a/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs @@ -2,19 +2,15 @@ using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; -public class Lexer : ILexer, IEnumerable +public class Lexer(Structure structure) : ILexer, IEnumerable { - private readonly List _lines = new(); + private readonly List _lines = []; private string _text = ""; - public Structure Structure { get; } - - public Lexer(Structure structure) => - Structure = structure; + public Structure Structure { get; } = structure; public List GetTokens(string text) { @@ -58,7 +54,7 @@ public IEnumerator GetEnumerator() } } - yield return new Token(new EndOfProgramType()); + yield return new EndToken(); } [ExcludeFromCodeCoverage] diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs index 7ed8db15..aee920f8 100644 --- a/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs +++ b/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs @@ -17,28 +17,28 @@ namespace HydraScript.Lib.FrontEnd.TopDownParse.Impl; public class Parser : IParser { - private TokensStream _tokens; + private TokensStream _tokens = new List(); private readonly ILexer _lexer; public Parser(ILexer lexer) => _lexer = lexer; - + public IAbstractSyntaxTree TopDownParse(string text) { _tokens = _lexer.GetTokens(text); - + var root = Script(); Expect("EOP"); return new AbstractSyntaxTree(root); } - private Token Expect(string expectedTag, string expectedValue = null) + private Token Expect(string expectedTag, string? expectedValue = null) { var current = _tokens.Current; if (!CurrentIs(expectedTag)) - throw new ParserException(_tokens.Current!.Segment, expectedTag, _tokens.Current); - if (_tokens.Current!.Value != (expectedValue ?? _tokens.Current.Value)) + throw new ParserException(_tokens.Current.Segment, expectedTag, _tokens.Current); + if (_tokens.Current.Value != (expectedValue ?? _tokens.Current.Value)) throw new ParserException(_tokens.Current.Segment, expectedValue, _tokens.Current); _tokens.MoveNext(); @@ -46,7 +46,7 @@ private Token Expect(string expectedTag, string expectedValue = null) } private bool CurrentIs(string tag) => - _tokens.Current!.Type == _lexer.Structure.FindByTag(tag); + _tokens.Current.Type == _lexer.Structure.FindByTag(tag); private bool CurrentIsLiteral() => CurrentIs("NullLiteral") || @@ -57,11 +57,11 @@ private bool CurrentIsLiteral() => private bool CurrentIsKeyword(string keyword) => CurrentIs("Keyword") && - _tokens.Current!.Value == keyword; + _tokens.Current.Value == keyword; private bool CurrentIsOperator(string @operator) => CurrentIs("Operator") && - _tokens.Current!.Value == @operator; + _tokens.Current.Value == @operator; private ScriptBody Script() => new(StatementList()); @@ -139,7 +139,7 @@ private Statement Statement() return WhileStatement(); } - return null; + return null!; } private BlockStatement BlockStatement() @@ -242,7 +242,7 @@ private TypeValue TypeValue() return WithSuffix(new ObjectTypeValue(propertyTypes)); } - return null; + return null!; } private TypeValue WithSuffix(TypeValue baseType) @@ -283,7 +283,7 @@ private Declaration Declaration() return TypeDeclaration(); } - return null; + return null!; } private FunctionDeclaration FunctionDeclaration() @@ -422,7 +422,7 @@ private Expression CallExpression() } Expect("RightParen"); - return new CallExpression(member as MemberExpression, expressions) + return new CallExpression((member as MemberExpression)!, expressions) { Segment = lp.Segment }; } @@ -465,9 +465,9 @@ private Expression MemberExpression() } return new MemberExpression( - identRef, + identRef!, accessChain.FirstOrDefault(), - tail: accessChain.LastOrDefault());; + tail: accessChain.LastOrDefault()); } private Expression CastExpression() @@ -651,12 +651,12 @@ private Expression PrimaryExpression() return ArrayLiteral(); } - return null; + return null!; } private Literal Literal() { - var segment = _tokens.Current!.Segment; + var segment = _tokens.Current.Segment; if (CurrentIs("StringLiteral")) { var str = Expect("StringLiteral"); diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs b/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs index 3e0f70a7..f4ba922f 100644 --- a/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs +++ b/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs @@ -12,7 +12,7 @@ public ParserException(string message) : base(message) { } protected ParserException(string message, Exception inner) : base(message, inner) { } - public ParserException(Segment segment, string expected, Token actual) : + public ParserException(Segment segment, string? expected, Token actual) : base($"Wrong syntax: {segment} expected {expected}; actual = ({actual.Type.Tag}, {actual.Value})") { } diff --git a/HydraScript.Lib/HydraScript.Lib.csproj b/HydraScript.Lib/HydraScript.Lib.csproj index a360d3fe..49bd9e07 100644 --- a/HydraScript.Lib/HydraScript.Lib.csproj +++ b/HydraScript.Lib/HydraScript.Lib.csproj @@ -3,6 +3,8 @@ net8.0 enable + enable + True diff --git a/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs index 35d651fe..7a815441 100644 --- a/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs +++ b/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs @@ -14,11 +14,11 @@ public abstract class AbstractSyntaxTreeNode : IEnumerable, IVisitable { - public AbstractSyntaxTreeNode Parent { get; set; } + public AbstractSyntaxTreeNode? Parent { get; set; } - public SymbolTable SymbolTable { get; set; } + public SymbolTable SymbolTable { get; set; } = default!; - public Segment Segment { get; init; } + public Segment Segment { get; init; } = default!; internal List GetAllNodes() { @@ -43,6 +43,7 @@ public bool ChildOf() where T : AbstractSyntaxTreeNode { return true; } + parent = parent.Parent; } @@ -61,7 +62,7 @@ public virtual Unit Accept(SymbolTableInitializer visitor) => public virtual Unit Accept(TypeSystemLoader visitor) => visitor.Visit(this); - + public virtual Unit Accept(DeclarationVisitor visitor) => visitor.Visit(this); @@ -71,9 +72,9 @@ public virtual Type Accept(SemanticChecker visitor) => public abstract AddressedInstructions Accept(InstructionProvider visitor); #endregion - + protected abstract string NodeRepresentation(); - + public override string ToString() => $"{GetHashCode()} [label=\"{NodeRepresentation()}\"]"; } \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs index 0701a740..ceb2c634 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -8,7 +8,7 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; public class FunctionDeclaration : AfterTypesAreLoadedDeclaration { - private IReadOnlyCollection _returnStatements; + private IReadOnlyCollection? _returnStatements; public IdentifierReference Name { get; } public TypeValue ReturnTypeValue { get; } diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs index 5be598e5..31e3d4dc 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs @@ -4,14 +4,14 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; public abstract class AccessExpression : Expression { - public AccessExpression Next { get; private set; } + public AccessExpression? Next { get; private set; } - public AccessExpression Prev => + public AccessExpression? Prev => Parent as AccessExpression; - public Type ComputedType { get; set; } + public Type ComputedType { get; set; } = default!; - protected AccessExpression(AccessExpression prev) + protected AccessExpression(AccessExpression? prev) { if (prev is not null) { diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs index 0263739b..36be5133 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -9,7 +9,7 @@ public class DotAccess : AccessExpression { public IdentifierReference Property { get; } - public DotAccess(IdentifierReference property, AccessExpression prev = null) : base(prev) + public DotAccess(IdentifierReference property, AccessExpression? prev = null) : base(prev) { Property = property; Property.Parent = this; @@ -20,7 +20,7 @@ public override IEnumerator GetEnumerator() yield return Property; if (HasNext()) { - yield return Next; + yield return Next!; } } diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs index 3c83762f..08e6d4c1 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -8,7 +8,7 @@ public class IndexAccess : AccessExpression { public Expression Index { get; } - public IndexAccess(Expression index, AccessExpression prev = null) : base(prev) + public IndexAccess(Expression index, AccessExpression? prev = null) : base(prev) { Index = index; Index.Parent = this; @@ -19,7 +19,7 @@ public override IEnumerator GetEnumerator() yield return Index; if (HasNext()) { - yield return Next; + yield return Next!; } } diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs index 6c959f6e..f677e4aa 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs @@ -9,12 +9,12 @@ public class AssignmentExpression : Expression { public LeftHandSideExpression Destination { get; } public Expression Source { get; } - public TypeValue DestinationType { get; } + public TypeValue? DestinationType { get; } public AssignmentExpression( LeftHandSideExpression lhs, Expression source, - TypeValue destinationType = null) + TypeValue? destinationType = null) { Destination = lhs; lhs.Parent = this; diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs index 7b13c7ea..2afcf034 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs @@ -10,7 +10,7 @@ public class Property : Expression public Expression Expression { get; } public ObjectLiteral Object => - Parent as ObjectLiteral; + (Parent as ObjectLiteral)!; public Property(IdentifierReference id, Expression expression) { diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs index 963c2355..9b7fe8f8 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs @@ -10,10 +10,10 @@ public class MemberExpression : LeftHandSideExpression { private readonly IdentifierReference _identifierReference; - public AccessExpression AccessChain { get; } - public AccessExpression Tail { get; } + public AccessExpression? AccessChain { get; } + public AccessExpression? Tail { get; } - public Type ComputedIdType { get; set; } + public Type ComputedIdType { get; set; } = default!; public MemberExpression(IdentifierReference identifierReference) : this(identifierReference, accessChain: null, tail: null) @@ -22,14 +22,14 @@ public MemberExpression(IdentifierReference identifierReference) : public MemberExpression( IdentifierReference identifierReference, - AccessExpression accessChain, - AccessExpression tail) + AccessExpression? accessChain, + AccessExpression? tail) { _identifierReference = identifierReference; _identifierReference.Parent = this; - + AccessChain = accessChain; - if (accessChain is not null) + if (AccessChain is not null) { AccessChain.Parent = this; } diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs index 04d99114..07bc31bb 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs @@ -3,14 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public class IdentifierReference : PrimaryExpression +public class IdentifierReference(string name) : PrimaryExpression { - public string Name { get; } - - public IdentifierReference(string name) - { - Name = name; - } + public string Name { get; } = name; protected override string NodeRepresentation() => Name; diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs index ec56306e..42f26320 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs @@ -4,13 +4,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public class ImplicitLiteral : PrimaryExpression +public class ImplicitLiteral(TypeValue typeValue) : PrimaryExpression { - public TypeValue TypeValue { get; } - public object ComputedDefaultValue { private get; set; } - - public ImplicitLiteral(TypeValue typeValue) => - TypeValue = typeValue; + public TypeValue TypeValue { get; } = typeValue; + public object? ComputedDefaultValue { private get; set; } protected override string NodeRepresentation() => TypeValue.ToString(); @@ -20,7 +17,7 @@ public override IValue ToValue() => ComputedDefaultValue, ComputedDefaultValue is null ? "null" - : ComputedDefaultValue.ToString()); + : ComputedDefaultValue.ToString()!); public override Type Accept(SemanticChecker visitor) => visitor.Visit(this); diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs index 2694cdad..b91ae3e4 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs @@ -8,17 +8,17 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; public class Literal : PrimaryExpression { private readonly TypeValue _type; - private readonly object _value; + private readonly object? _value; private readonly string _label; public Literal( TypeValue type, - object value, + object? value, Segment segment, - string label = null) + string? label = null) { _type = type; - _label = label ?? value.ToString(); + _label = (label ?? value?.ToString())!; _value = value; Segment = segment; } @@ -29,5 +29,5 @@ public override IValue ToValue() => new Constant(_value, _label); public override Type Accept(SemanticChecker visitor) => - _type.BuildType(Parent.SymbolTable); + _type.BuildType(Parent!.SymbolTable); } \ No newline at end of file diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs index f9676cd1..4bc356d9 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs @@ -8,9 +8,9 @@ public class IfStatement : Statement { public Expression Test { get; } public Statement Then { get; } - public Statement Else { get; } + public Statement? Else { get; } - public IfStatement(Expression test, Statement then, Statement @else = null) + public IfStatement(Expression test, Statement then, Statement? @else = null) { Test = test; Test.Parent = this; diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs index 3901f690..ee8cf85b 100644 --- a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs +++ b/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs @@ -6,12 +6,12 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; public class ReturnStatement : Statement { - public Expression Expression { get; } + public Expression? Expression { get; } - public ReturnStatement(Expression expression = null) + public ReturnStatement(Expression? expression = null) { Expression = expression; - if (expression is not null) + if (Expression is not null) { Expression.Parent = this; } diff --git a/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs index 02faff77..b3b5fe95 100644 --- a/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs +++ b/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs @@ -31,7 +31,7 @@ public class ExpressionInstructionProvider : IVisitor { public AddressedInstructions Visit(PrimaryExpression visitable) => - new() { new Simple(visitable.ToValue()) }; + [new Simple(visitable.ToValue())]; public AddressedInstructions Visit(ArrayLiteral visitable) { @@ -52,7 +52,7 @@ public AddressedInstructions Visit(ArrayLiteral visitable) else { result.AddRange(expression.Accept(this)); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new IndexAssignment(arrayName, index, last)); } } @@ -82,11 +82,10 @@ public AddressedInstructions Visit(Property visitable) var propertyId = new Constant(id); if (expression is PrimaryExpression primary) - return new AddressedInstructions - { new DotAssignment(objectId, propertyId, primary.ToValue()) }; + return [new DotAssignment(objectId, propertyId, primary.ToValue())]; var instructions = expression.Accept(this); - var last = new Name(instructions.OfType().Last().Left); + var last = new Name(instructions.OfType().Last().Left!); instructions.Add(new DotAssignment(objectId, propertyId, last)); return instructions; @@ -95,10 +94,10 @@ public AddressedInstructions Visit(Property visitable) public AddressedInstructions Visit(UnaryExpression visitable) { if (visitable.Expression is PrimaryExpression primary) - return new() { new Simple(visitable.Operator, primary.ToValue()) }; + return [new Simple(visitable.Operator, primary.ToValue())]; var result = visitable.Expression.Accept(this); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new Simple(visitable.Operator, last)); return result; @@ -106,13 +105,8 @@ public AddressedInstructions Visit(UnaryExpression visitable) public AddressedInstructions Visit(BinaryExpression visitable) { - if (visitable.Left is IdentifierReference arr && - visitable.Right is PrimaryExpression primary && - visitable.Operator == "::") - return new AddressedInstructions - { - new RemoveFromArray(arr.Name, primary.ToValue()) - }; + if (visitable is { Left: IdentifierReference arr, Right: PrimaryExpression primary, Operator: "::" }) + return [new RemoveFromArray(arr.Name, primary.ToValue())]; var result = new AddressedInstructions(); IValue left, right; @@ -122,7 +116,7 @@ visitable.Right is PrimaryExpression primary && else { result.AddRange(visitable.Left.Accept(this)); - left = new Name(result.OfType().Last().Left); + left = new Name(result.OfType().Last().Left!); } if (visitable.Right is PrimaryExpression primaryRight) @@ -130,7 +124,7 @@ visitable.Right is PrimaryExpression primary && else { result.AddRange(visitable.Right.Accept(this)); - right = new Name(result.OfType().Last().Left); + right = new Name(result.OfType().Last().Left!); } result.Add(new Simple(left, visitable.Operator, right)); @@ -141,10 +135,10 @@ visitable.Right is PrimaryExpression primary && public AddressedInstructions Visit(CastAsExpression visitable) { if (visitable.Expression is PrimaryExpression primary) - return new() { new AsString(primary.ToValue()) }; + return [new AsString(primary.ToValue())]; var result = visitable.Expression.Accept(this); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new AsString(last)); return result; @@ -163,12 +157,12 @@ public AddressedInstructions Visit(ConditionalExpression visitable) else { result.AddRange(visitable.Test.Accept(this)); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new IfNotGoto(last, startBlockLabel)); } result.AddRange(visitable.Consequent.Accept(this)); - var temp = result.OfType().Last().Left; + var temp = result.OfType().Last().Left!; result.Add(new Goto(endBlockLabel)); result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); @@ -190,14 +184,14 @@ public AddressedInstructions Visit(AssignmentExpression visitable) if (last is IWriteToComplexData assignment) result.Add(assignment.ToSimple()); else - result.Add(new Simple(new Name(last.Left))); + result.Add(new Simple(new Name(last.Left!))); } if (visitable.Destination.Empty()) result.OfType().Last().Left = visitable.Destination.Id; else { - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.AddRange(visitable.Destination.Accept(this)); var lastRead = result.OfType().Last(); result.Replace(lastRead.ToInstruction(), lastRead.ToAssignment(last)); @@ -208,21 +202,18 @@ public AddressedInstructions Visit(AssignmentExpression visitable) public AddressedInstructions Visit(MemberExpression visitable) => visitable.Empty() - ? new AddressedInstructions() - : visitable.Tail.Accept(this); + ? [] + : visitable.Tail?.Accept(this) ?? []; public AddressedInstructions Visit(DotAccess visitable) { var right = new Constant(visitable.Property.Name); if (!visitable.HasPrev() && visitable.Parent is LeftHandSideExpression lhs) - return new AddressedInstructions - { - new DotRead(new Name(lhs.Id), right) - }; - - var result = visitable.Prev.Accept(this); - var left = new Name(result.OfType().Last().Left); + return [new DotRead(new Name(lhs.Id), right)]; + + var result = visitable.Prev?.Accept(this) ?? []; + var left = new Name(result.OfType().Last().Left!); result.Add(new DotRead(left, right)); return result; @@ -239,15 +230,15 @@ public AddressedInstructions Visit(IndexAccess visitable) else { result.AddRange(visitable.Index.Accept(this)); - right = new Name(result.OfType().Last().Left); + right = new Name(result.OfType().Last().Left!); } if (!visitable.HasPrev() && visitable.Parent is LeftHandSideExpression lhs) result.Add(new IndexRead(new Name(lhs.Id), right)); else { - result.AddRange(visitable.Prev.Accept(this)); - var left = new Name(result.OfType().Last().Left); + result.AddRange(visitable.Prev?.Accept(this) ?? []); + var left = new Name(result.OfType().Last().Left!); result.Add(new IndexRead(left, right)); } @@ -262,10 +253,10 @@ public AddressedInstructions Visit(CallExpression visitable) var param = visitable.Parameters[0]; if (param is PrimaryExpression prim) - return new AddressedInstructions { new Print(prim.ToValue()) }; + return [new Print(prim.ToValue())]; var result = param.Accept(this); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new Print(last)); return result; @@ -273,7 +264,7 @@ public AddressedInstructions Visit(CallExpression visitable) else { FunctionSymbol functionSymbol; - AddressedInstructions result = new(); + AddressedInstructions result = []; if (methodCall) { var memberInstructions = visitable.Member.Accept(this); @@ -283,20 +274,20 @@ public AddressedInstructions Visit(CallExpression visitable) var methodName = lastMemberInstruction.Property; functionSymbol = visitable.SymbolTable - .FindSymbol(methodName); + .FindSymbol(methodName)!; } else { functionSymbol = visitable.SymbolTable - .FindSymbol(visitable.Id); + .FindSymbol(visitable.Id)!; } if (functionSymbol.IsEmpty) - return new AddressedInstructions(); + return []; var functionInfo = new FunctionInfo(functionSymbol.Id); if (methodCall) { - var caller = result.Any() ? result.OfType().Last().Left : visitable.Id; + var caller = result.Any() ? result.OfType().Last().Left! : visitable.Id; result.Add(new PushParameter(functionSymbol.Parameters[0].Id, new Name(caller))); } foreach (var (expr, symbol) in visitable.Parameters @@ -307,7 +298,7 @@ public AddressedInstructions Visit(CallExpression visitable) else { result.AddRange(expr.Accept(this)); - var id = result.OfType().Last().Left; + var id = result.OfType().Last().Left!; result.Add(new PushParameter(symbol.Id, new Name(id))); } } diff --git a/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs index 8aa90562..fba62c24 100644 --- a/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs +++ b/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs @@ -71,7 +71,7 @@ public AddressedInstructions Visit(InsideStatementJump visitable) "Unsupported keyword inside loop") }; - return new() { new Goto(jumpType) }; + return [new Goto(jumpType)]; } public AddressedInstructions Visit(ExpressionStatement visitable) => @@ -82,13 +82,13 @@ public AddressedInstructions Visit(ReturnStatement visitable) switch (visitable.Expression) { case null: - return new() { new Return() }; + return [new Return()]; case PrimaryExpression primary: - return new() { new Return(primary.ToValue()) }; + return [new Return(primary.ToValue())]; } var result = visitable.Expression.Accept(_expressionVisitor); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new Return(last)); return result; @@ -97,7 +97,7 @@ public AddressedInstructions Visit(ReturnStatement visitable) public AddressedInstructions Visit(FunctionDeclaration visitable) { if (!visitable.Statements.Any()) - return new(); + return []; var functionInfo = new FunctionInfo(visitable.Name); @@ -135,7 +135,7 @@ public AddressedInstructions Visit(WhileStatement visitable) else { result.AddRange(visitable.Condition.Accept(_expressionVisitor)); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new IfNotGoto(last, endBlockLabel)); } @@ -164,7 +164,7 @@ public AddressedInstructions Visit(WhileStatement visitable) public AddressedInstructions Visit(IfStatement visitable) { if (visitable.Empty()) - return new(); + return []; var blockId = $"if_else_{visitable.GetHashCode()}"; var startBlockLabel = new Label($"Start_{blockId}"); @@ -177,7 +177,7 @@ public AddressedInstructions Visit(IfStatement visitable) else { result.AddRange(visitable.Test.Accept(_expressionVisitor)); - var last = new Name(result.OfType().Last().Left); + var last = new Name(result.OfType().Last().Left!); result.Add(new IfNotGoto(last, visitable.HasElseBlock() ? startBlockLabel @@ -190,7 +190,7 @@ public AddressedInstructions Visit(IfStatement visitable) result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); if (visitable.HasElseBlock()) - result.AddRange(visitable.Else.Accept(this)); + result.AddRange(visitable.Else?.Accept(this) ?? []); result.OfType().Where(g => g.JumpType is InsideStatementJumpType.Break) .ToList().ForEach(g=> g.SetJump(endBlockLabel)); diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs b/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs index 652758fe..2d0de4f3 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs @@ -1,12 +1,8 @@ namespace HydraScript.Lib.IR.CheckSemantics.Types; -public class Any : Type +public class Any() : Type("any") { - public Any() : base("any") - { - } - - public override bool Equals(object obj) => true; + public override bool Equals(object? obj) => true; public override int GetHashCode() => "any".GetHashCode(); } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs index 60168d34..433bddb0 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs @@ -1,17 +1,13 @@ namespace HydraScript.Lib.IR.CheckSemantics.Types; -public class ArrayType : Type +public class ArrayType(Type type) : Type($"{type}[]") { - public Type Type { get; private set; } - - public ArrayType(Type type) : - base($"{type}[]") => - Type = type; + public Type Type { get; private set; } = type; public override void ResolveReference( Type reference, string refId, - ISet visited = null) + ISet? visited = null) { if (Type == refId) Type = reference; @@ -19,14 +15,14 @@ public override void ResolveReference( Type.ResolveReference(reference, refId, visited); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is ArrayType that) return Equals(Type, that.Type); return obj is Any; } - - public override int GetHashCode() => + + public override int GetHashCode() => // ReSharper disable once NonReadonlyMemberInGetHashCode Type.GetHashCode(); } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs index b3886910..45ddddc5 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs @@ -1,12 +1,8 @@ namespace HydraScript.Lib.IR.CheckSemantics.Types; -public class NullType : Type +public class NullType() : Type("null") { - public NullType() : base("null") - { - } - - public override bool Equals(object obj) => + public override bool Equals(object? obj) => obj is NullableType or NullType or Any; public override int GetHashCode() => diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs index f88327c3..4d1cab73 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs @@ -2,8 +2,8 @@ namespace HydraScript.Lib.IR.CheckSemantics.Types; public class NullableType : Type { - public Type Type { get; private set; } - + public Type Type { get; private set; } = default!; + public NullableType(Type type) : base($"{type}?") => Type = type; @@ -15,7 +15,7 @@ protected NullableType() public override void ResolveReference( Type reference, string refId, - ISet visited = null) + ISet? visited = null) { if (Type == refId) Type = reference; @@ -23,7 +23,7 @@ public override void ResolveReference( Type.ResolveReference(reference, refId, visited); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is NullableType that) return Equals(Type, that.Type); diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs b/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs index 0726d241..3daf72e2 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs @@ -9,7 +9,7 @@ public class ObjectType : NullableType private readonly ObjectTypeHasher _hasher; private readonly ObjectTypePrinter _serializer; - public string LastAccessedMethod { get; private set; } + public string LastAccessedMethod { get; private set; } = default!; public ObjectType(IEnumerable properties) { @@ -24,10 +24,10 @@ public ObjectType(IEnumerable properties) _serializer = new ObjectTypePrinter(this); } - public Type this[string id] + public Type? this[string id] { get => _properties.GetValueOrDefault(id); - private set => _properties[id] = value; + private set => _properties[id] = value!; } public void AddMethod(string methodName) => @@ -42,20 +42,20 @@ public bool HasMethod(string methodName) public override void ResolveReference( Type reference, string refId, - ISet visited = null) + ISet? visited = null) { visited ??= new HashSet(); if (!visited.Add(this)) return; foreach (var key in _properties.Keys) - if (refId == this[key]) + if (refId == this[key]!) this[key] = reference; else - this[key].ResolveReference(reference, refId, visited); + this[key]!.ResolveReference(reference, refId, visited); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is ObjectType that) return ReferenceEquals(this, that) || @@ -97,9 +97,9 @@ public int HashObjectType(ObjectType objectType) => objectType._properties.Keys.Select( key => HashCode.Combine( key, - objectType[key].Equals(_reference) + objectType[key]!.Equals(_reference) ? "@this".GetHashCode() - : objectType[key].GetType().GetHashCode())) + : objectType[key]!.GetType().GetHashCode())) .Aggregate(36, HashCode.Combine); private int HashArrayType(ArrayType arrayType) => @@ -147,7 +147,7 @@ public string PrintObjectType(ObjectType objectType) var type = objectType[key]; var prop = $"{key}: "; - if (type.Equals(_reference)) + if (type!.Equals(_reference)) prop += "@this"; else { diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs b/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs index 66a30874..a91ea5aa 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs @@ -2,7 +2,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Types; public class Type { - private readonly string _name; + private readonly string _name = default!; protected Type() { @@ -14,11 +14,11 @@ public Type(string name) => public virtual void ResolveReference( Type reference, string refId, - ISet visited = null) + ISet? visited = null) { } - public override bool Equals(object obj) => + public override bool Equals(object? obj) => obj switch { Any => true, @@ -26,7 +26,7 @@ public override bool Equals(object obj) => _ => false }; - public override int GetHashCode() => + public override int GetHashCode() => _name.GetHashCode(); public override string ToString() => _name; diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs index b36c2e63..86ea0d8d 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs @@ -6,7 +6,7 @@ public class SymbolTable { private readonly Dictionary _symbols = new(); - private SymbolTable _openScope; + private SymbolTable? _openScope; public void AddOpenScope(SymbolTable table) { @@ -17,7 +17,7 @@ public void AddOpenScope(SymbolTable table) /// Символы доступные в области видимости таблицы /// public IEnumerable GetAvailableSymbols() => - _symbols.Values.Concat(_openScope?.GetAvailableSymbols() ?? Array.Empty()); + _symbols.Values.Concat(_openScope?.GetAvailableSymbols() ?? []); public void AddSymbol(Symbol symbol) => _symbols[symbol.Id] = symbol; @@ -25,7 +25,7 @@ public void AddSymbol(Symbol symbol) => /// /// Поиск эффективного символа /// - public TSymbol FindSymbol(string id) where TSymbol : Symbol + public TSymbol? FindSymbol(string id) where TSymbol : Symbol { var hasInsideTheScope = _symbols.TryGetValue(id, out var symbol); return !hasInsideTheScope diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs index fc5bfb82..c6af2c56 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs @@ -2,30 +2,21 @@ namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; -public class FunctionSymbol : Symbol +public class FunctionSymbol( + string id, + IEnumerable parameters, + Type type, + bool isEmpty) : Symbol { - private Type _returnType; - - public override string Id { get; } - /// Тип возврата функции - public override Type Type => _returnType; - public IReadOnlyList Parameters { get; } - public bool IsEmpty { get; } + public override string Id { get; } = id; - public FunctionSymbol( - string id, - IEnumerable parameters, - Type returnType, - bool isEmpty) - { - Id = id; - Parameters = new List(parameters); - _returnType = returnType; - IsEmpty = isEmpty; - } + /// Тип возврата функции + public override Type Type => type; + public IReadOnlyList Parameters { get; } = new List(parameters); + public bool IsEmpty { get; } = isEmpty; public void DefineReturnType(Type returnType) => - _returnType = returnType; + type = returnType; public override string ToString() => new StringBuilder($"function {Id}(") diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs index db59ea0d..ad855412 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs @@ -2,13 +2,8 @@ namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; -public class ObjectSymbol : VariableSymbol +public class ObjectSymbol(string id, ObjectType objectType, bool readOnly = false) + : VariableSymbol(id, objectType, readOnly) { - public override ObjectType Type { get; } - - public ObjectSymbol(string id, ObjectType objectType, bool readOnly = false) : - base(id, objectType, readOnly) - { - Type = objectType; - } + public override ObjectType Type { get; } = objectType; } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs index f36267d0..3d7970a5 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs @@ -1,17 +1,11 @@ namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; -public class TypeSymbol : Symbol +public class TypeSymbol(Type type, string? id = null) : Symbol { - public override string Id { get; } - public override Type Type { get; } - - public TypeSymbol(Type type, string id = null) - { - Id = id ?? type.ToString(); - Type = type; - } + public override string Id { get; } = id ?? type.ToString(); + public override Type Type { get; } = type; - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj is TypeSymbol typeSymbol) { diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs index 1bff17a3..ced931a3 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs @@ -1,17 +1,10 @@ namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; -public class VariableSymbol : Symbol +public class VariableSymbol(string id, Type type, bool readOnly = false) : Symbol { - public override string Id { get; } - public override Type Type { get; } - public bool ReadOnly { get; } - - public VariableSymbol(string id, Type type, bool readOnly = false) - { - Id = id; - Type = type; - ReadOnly = readOnly; - } + public override string Id { get; } = id; + public override Type Type { get; } = type; + public bool ReadOnly { get; } = readOnly; public override string ToString() => $"{(ReadOnly ? "const " : "")}{Id}: {Type}"; } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs index 9a1c4f4f..1bb19bc2 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs @@ -61,7 +61,7 @@ public Unit Visit(LexicalDeclaration visitable) public Unit Visit(FunctionDeclaration visitable) { - if (visitable.Parent.SymbolTable.ContainsSymbol(visitable.Name)) + if (visitable.Parent!.SymbolTable.ContainsSymbol(visitable.Name)) throw new DeclarationAlreadyExists(visitable.Name); var parameters = visitable.Arguments.Select(x => diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs index 36346fdb..62c1b398 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs @@ -128,7 +128,7 @@ public Type Visit(IdentifierReference visitable) public Type Visit(ImplicitLiteral visitable) { - var type = visitable.TypeValue.BuildType(visitable.Parent.SymbolTable); + var type = visitable.TypeValue.BuildType(visitable.Parent!.SymbolTable); visitable.ComputedDefaultValue = _calculator.GetDefaultValueForType(type); return type; } @@ -249,7 +249,7 @@ public Type Visit(LexicalDeclaration visitable) var sourceType = assignment.Source.Accept(this); if (sourceType.Equals(undefined)) throw new CannotDefineType(assignment.Source.Segment); - if (!registeredSymbol.Type.Equals(undefined) && !registeredSymbol.Type.Equals(sourceType)) + if (!registeredSymbol!.Type.Equals(undefined) && !registeredSymbol.Type.Equals(sourceType)) throw new IncompatibleTypesOfOperands( assignment.Segment, left: registeredSymbol.Type, @@ -307,7 +307,7 @@ public Type Visit(MemberExpression visitable) { var idType = visitable.Id.Accept(this); visitable.ComputedIdType = idType; - return visitable.Empty() ? idType : visitable.AccessChain?.Accept(this); + return visitable.Empty() ? idType : visitable.AccessChain?.Accept(this) ?? "undefined"; } public Type Visit(IndexAccess visitable) @@ -326,7 +326,7 @@ public Type Visit(IndexAccess visitable) var elemType = arrayType.Type; visitable.ComputedType = elemType; - return visitable.HasNext() ? visitable.Next.Accept(this) : elemType; + return visitable.HasNext() ? visitable.Next?.Accept(this) ?? "undefined" : elemType; } public Type Visit(DotAccess visitable) @@ -345,7 +345,7 @@ public Type Visit(DotAccess visitable) ? objectType : throw new ObjectAccessException(visitable.Segment, objectType, visitable.Property); visitable.ComputedType = fieldType; - return visitable.HasNext() ? visitable.Next.Accept(this) : fieldType; + return visitable.HasNext() ? visitable.Next?.Accept(this) ?? "undefined" : fieldType; } public Type Visit(CastAsExpression visitable) @@ -411,7 +411,7 @@ symbol as FunctionSymbol public Type Visit(FunctionDeclaration visitable) { - var symbol = visitable.SymbolTable.FindSymbol(visitable.Name); + var symbol = visitable.SymbolTable.FindSymbol(visitable.Name)!; _functionStorage.RemoveIfPresent(symbol); visitable.Statements.Accept(this); diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs index a833943c..9d0b66f5 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs @@ -2,5 +2,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; public interface IDefaultValueForTypeCalculator { - public object GetDefaultValueForType(Type type); + public object? GetDefaultValueForType(Type type); } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs index 90c8baee..0d71ebbd 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs @@ -10,7 +10,7 @@ internal class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator private readonly Type _void = "void"; private readonly Type _null = new NullType(); - public object GetDefaultValueForType(Type type) + public object? GetDefaultValueForType(Type type) { if (type.Equals(_boolean)) return false; diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs index 8564f59a..86dc7c1d 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs @@ -5,11 +5,11 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; internal class SymbolTableInitializerService : ISymbolTableInitializerService { public void InitThroughParent(AbstractSyntaxTreeNode node) => - node.SymbolTable = node.Parent.SymbolTable; + node.SymbolTable = node.Parent!.SymbolTable; public void InitWithNewScope(AbstractSyntaxTreeNode node) { node.SymbolTable = new(); - node.SymbolTable.AddOpenScope(node.Parent.SymbolTable); + node.SymbolTable.AddOpenScope(node.Parent!.SymbolTable); } } \ No newline at end of file diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs index 0d8134b8..d7c5443d 100644 --- a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs +++ b/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs @@ -28,12 +28,12 @@ public void Resolve() declarationToResolve.TypeId)); } - while (_declarationsToResolve.Any()) + while (_declarationsToResolve.Count != 0) { var declarationToResolve = _declarationsToResolve.Dequeue(); var typeSymbol = declarationToResolve.SymbolTable - .FindSymbol(declarationToResolve.TypeId); + .FindSymbol(declarationToResolve.TypeId)!; var resolvingCandidates = declarationToResolve.SymbolTable .GetAvailableSymbols() diff --git a/HydraScript.Tests/HydraScript.Tests.csproj b/HydraScript.Tests/HydraScript.Tests.csproj index ccda5d99..6fd1c843 100644 --- a/HydraScript.Tests/HydraScript.Tests.csproj +++ b/HydraScript.Tests/HydraScript.Tests.csproj @@ -4,6 +4,8 @@ net8.0 false enable + enable + True diff --git a/HydraScript.Tests/Unit/BackEnd/CallTests.cs b/HydraScript.Tests/Unit/BackEnd/CallTests.cs index e774efcd..57469fcc 100644 --- a/HydraScript.Tests/Unit/BackEnd/CallTests.cs +++ b/HydraScript.Tests/Unit/BackEnd/CallTests.cs @@ -9,12 +9,10 @@ public class CallTests [Fact] public void ToStringCorrect() { - var call = new Call(new Label("9"), new FunctionInfo("func"), - new List<(string Id, object Value)> - { - ("arg", 1) - } - ); + var call = new Call( + new Label("9"), + new FunctionInfo("func"), + [("arg", 1)]); const string expected = "9:\n\t => Start_func:\n\t: func(arg: 1)"; Assert.Equal(expected, call.ToString()); } diff --git a/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs b/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs index 9caed316..35979ae0 100644 --- a/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs +++ b/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs @@ -18,6 +18,6 @@ public void GotoJumpChangedTest() { var @goto = new Goto(new Label("1")); @goto.SetJump(new Label("5")); - Assert.Equal(new Label("5"), @goto.Execute(vm: null)); + Assert.Equal(new Label("5"), @goto.Execute(vm: new())); } } \ No newline at end of file diff --git a/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs b/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs index 387d9d99..648b31e1 100644 --- a/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs +++ b/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs @@ -1,4 +1,3 @@ -#nullable enable using HydraScript.Lib.BackEnd; using HydraScript.Lib.BackEnd.Addresses; using HydraScript.Lib.BackEnd.Instructions; @@ -119,21 +118,21 @@ public void CreateArrayReservesCertainSpaceTest() Address = new HashAddress(1) }; createArray.Execute(vm); - Assert.Equal(6, ((List) vm.Frames.Peek()["arr"]).Count); + Assert.Equal(6, ((List) vm.Frames.Peek()["arr"]!).Count); var indexAssignment = new IndexAssignment("arr", new Constant(0), new Constant(0)) { Address = new HashAddress(2) }; indexAssignment.Execute(vm); - Assert.Equal(0, ((List) vm.Frames.Peek()["arr"])[0]); + Assert.Equal(0, ((List) vm.Frames.Peek()["arr"]!)[0]); var removeFromArray = new RemoveFromArray("arr", new Constant(5)) { Address = new HashAddress(3) }; removeFromArray.Execute(vm); - Assert.Equal(5, ((List) vm.Frames.Peek()["arr"]).Count); + Assert.Equal(5, ((List) vm.Frames.Peek()["arr"]!).Count); } [Fact] @@ -150,7 +149,7 @@ public void ObjectCreationTest() _vm.Run(program); halt.Verify(x => x.Execute( It.Is( - vm => ((Dictionary)vm.Frames.Peek()["obj"])["prop"] == null + vm => ((Dictionary)vm.Frames.Peek()["obj"]!)["prop"] == null ) ), Times.Once()); _vm.Frames.Pop(); diff --git a/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs b/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs index 79db637e..58bf7ac5 100644 --- a/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs +++ b/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs @@ -66,7 +66,7 @@ public void RecursiveTypeReferenceResolvingTest() linkedListType.ResolveReference(linkedListType, refId: "self"); - Assert.Equal(linkedListType, ((ObjectType)linkedListType["wrapped"])["next"]); + Assert.Equal(linkedListType, ((ObjectType)linkedListType["wrapped"]!)["next"]); Assert.Equal(linkedListType, array.Type); Assert.Equal(linkedListType, nullable.Type); } diff --git a/HydraScript/CommandLineSettings.cs b/HydraScript/CommandLineSettings.cs index f51a63d4..87022f86 100644 --- a/HydraScript/CommandLineSettings.cs +++ b/HydraScript/CommandLineSettings.cs @@ -11,7 +11,7 @@ namespace HydraScript; public class CommandLineSettings { [Value(0, MetaName = "InputFilePath", Required = true, HelpText = "Path to input file")] - public string InputFilePath { get; set; } + public required string InputFilePath { get; set; } [Option('d', "dump", Default = false, HelpText = "Show dump data of interpreter")] public bool Dump { get; set; } diff --git a/HydraScript/HydraScript.csproj b/HydraScript/HydraScript.csproj index 0f591400..db5fd8de 100644 --- a/HydraScript/HydraScript.csproj +++ b/HydraScript/HydraScript.csproj @@ -5,6 +5,8 @@ net8.0 1.2.6 enable + enable + True diff --git a/HydraScript/Program.cs b/HydraScript/Program.cs index fc56feb3..2c4b1b21 100644 --- a/HydraScript/Program.cs +++ b/HydraScript/Program.cs @@ -22,14 +22,14 @@ namespace HydraScript; public static class Program { private static IServiceCollection ServiceCollection { get; } = new ServiceCollection(); - private static IServiceProvider ServiceProvider { get; set; } + private static IServiceProvider? ServiceProvider { get; set; } private static void Main(string[] args) => Parser.Default.ParseArguments(args) .WithParsed(options => { ConfigureServices(options); - ServiceProvider + ServiceProvider? .GetService()! .Execute(); }) diff --git a/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs b/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs index d03b5cd3..9f7ce424 100644 --- a/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs +++ b/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs @@ -14,7 +14,7 @@ public Structure CreateStructure() => new JsonSerializerOptions { Converters = { new StructureReadConverter() } - }); + })!; [ExcludeFromCodeCoverage] private class StructureReadConverter : JsonConverter @@ -26,8 +26,8 @@ public override Structure Read(ref Utf8JsonReader reader, var tokenTypes = jsonDocument.RootElement .EnumerateArray().Select(element => { - var tag = element.GetProperty("tag").GetString(); - var pattern = element.GetProperty("pattern").GetString(); + var tag = element.GetProperty("tag").GetString()!; + var pattern = element.GetProperty("pattern").GetString()!; var priority = element.GetProperty("priority").GetInt32(); var ignorable = element.TryGetProperty("canIgnore", out var canIgnore); diff --git a/samples/summator.js b/samples/summator.js index 029e6803..74d21b31 100644 --- a/samples/summator.js +++ b/samples/summator.js @@ -1,4 +1,4 @@ -type summable{ +type summable = { x: number; y: number; } From 539bf4916572aa3b18b0fa3675745154e2209034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Fri, 26 Jul 2024 00:02:46 +0300 Subject: [PATCH 09/35] Feature/lexer issue 58 (#67) * fix warnings * #58 - feature * #58 - tests * #58 - fix tests --- .../BackEnd/Instructions/WithJump/Goto.cs | 10 ++-- .../Instructions/WithJump/IfNotGoto.cs | 4 +- .../ITextCoordinateSystemComputer.cs | 6 +++ .../FrontEnd/GetTokens/Impl/Lexer.cs | 16 ++----- .../Impl/TextCoordinateSystemComputer.cs | 31 ++++++++++++ HydraScript.Tests/GlobalUsings.cs | 2 +- HydraScript.Tests/HydraScript.Tests.csproj | 1 + HydraScript.Tests/Unit/FrontEnd/LexerTests.cs | 9 ++-- .../Unit/FrontEnd/ParserTests.cs | 13 ++--- .../TextCoordinateSystemComputerTests.cs | 47 +++++++++++++++++++ .../Unit/Infrastructure/ProvidersTests.cs | 6 ++- HydraScript/Program.cs | 3 ++ .../Services/Executor/Impl/Executor.cs | 1 - .../LexerProvider/Impl/LexerProvider.cs | 5 +- 14 files changed, 115 insertions(+), 39 deletions(-) create mode 100644 HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs create mode 100644 HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs create mode 100644 HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs index 0611adc1..136e6d64 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs @@ -4,24 +4,24 @@ namespace HydraScript.Lib.BackEnd.Instructions.WithJump; public class Goto : Instruction { - protected Label jump = default!; + protected Label Jump = default!; public InsideStatementJumpType? JumpType { get; } public Goto(Label jump) => - this.jump = jump; + this.Jump = jump; public Goto(InsideStatementJumpType jumpType) => JumpType = jumpType; public override IAddress Execute(VirtualMachine vm) => - jump; + Jump; public void SetJump(Label newJump) => - jump = newJump; + Jump = newJump; protected override string ToStringInternal() => - $"Goto {jump.Name}"; + $"Goto {Jump.Name}"; } public enum InsideStatementJumpType diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs b/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs index d3580220..5e58816b 100644 --- a/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs +++ b/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs @@ -15,10 +15,10 @@ public override IAddress Execute(VirtualMachine vm) { var frame = vm.Frames.Peek(); return !Convert.ToBoolean(_test.Get(frame)) - ? jump + ? Jump : Address.Next; } protected override string ToStringInternal() => - $"IfNot {_test} Goto {jump.Name}"; + $"IfNot {_test} Goto {Jump.Name}"; } \ No newline at end of file diff --git a/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs b/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs new file mode 100644 index 00000000..0d6bfbaa --- /dev/null +++ b/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.FrontEnd.GetTokens; + +public interface ITextCoordinateSystemComputer +{ + IReadOnlyList GetLines(string text); +} \ No newline at end of file diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs index d86e4ef7..6eca3419 100644 --- a/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs +++ b/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs @@ -5,9 +5,9 @@ namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; -public class Lexer(Structure structure) : ILexer, IEnumerable +public class Lexer(Structure structure, ITextCoordinateSystemComputer computer) : ILexer, IEnumerable { - private readonly List _lines = []; + private IReadOnlyList _lines = []; private string _text = ""; public Structure Structure { get; } = structure; @@ -15,17 +15,7 @@ public class Lexer(Structure structure) : ILexer, IEnumerable public List GetTokens(string text) { _text = text; - - _lines.Clear(); - if (!string.IsNullOrEmpty(text)) - { - var lineMatches = - new Regex(@"(?\n)").Matches(text[^1] == '\n' - ? text - : new string(text.Append('\n').ToArray())); - foreach (Match match in lineMatches) - _lines.Add(match.Groups["NEWLINE"].Index); - } + _lines = computer.GetLines(_text); return this.Where(t => !t.Type.CanIgnore()).ToList(); } diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs b/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs new file mode 100644 index 00000000..73423828 --- /dev/null +++ b/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs @@ -0,0 +1,31 @@ +using System.Buffers; + +namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; + +public class TextCoordinateSystemComputer : ITextCoordinateSystemComputer +{ + private readonly SearchValues _sv = SearchValues.Create(['\n']); + + public IReadOnlyList GetLines(string text) + { + var newText = text.EndsWith(Environment.NewLine) + ? text + : text + Environment.NewLine; + var textLength = newText.Length; + + LinkedList indices = []; + while (true) + { + var start = indices.Last != null ? indices.Last.Value + 1 : 0; + if (start == textLength) + break; + var textAsSpan = newText.AsSpan( + start, + length: textLength - start); + var index = textAsSpan.IndexOfAny(_sv); + indices.AddLast(start + index); + } + + return indices.ToList(); + } +} \ No newline at end of file diff --git a/HydraScript.Tests/GlobalUsings.cs b/HydraScript.Tests/GlobalUsings.cs index 62a254b9..4f46c67a 100644 --- a/HydraScript.Tests/GlobalUsings.cs +++ b/HydraScript.Tests/GlobalUsings.cs @@ -1,3 +1,3 @@ // Global using directives - +global using FluentAssertions; global using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; \ No newline at end of file diff --git a/HydraScript.Tests/HydraScript.Tests.csproj b/HydraScript.Tests/HydraScript.Tests.csproj index 6fd1c843..57194398 100644 --- a/HydraScript.Tests/HydraScript.Tests.csproj +++ b/HydraScript.Tests/HydraScript.Tests.csproj @@ -14,6 +14,7 @@ + diff --git a/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs b/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs index 41da0480..d3b4c30a 100644 --- a/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs +++ b/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs @@ -8,12 +8,9 @@ namespace HydraScript.Tests.Unit.FrontEnd; public class LexerTests { - private readonly Lexer _lexer; - - public LexerTests() - { - _lexer = new Lexer(new StructureProvider().CreateStructure()); - } + private readonly Lexer _lexer = new( + new StructureProvider().CreateStructure(), + new TextCoordinateSystemComputer()); [Theory] [ClassData(typeof(LexerSuccessData))] diff --git a/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs b/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs index ebb513c8..f7498821 100644 --- a/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs +++ b/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs @@ -9,15 +9,10 @@ namespace HydraScript.Tests.Unit.FrontEnd; public class ParserTests { - private readonly IParser _parser; - - public ParserTests() - { - _parser = new Parser(new Lexer( - new StructureProvider() - .CreateStructure() - )); - } + private readonly IParser _parser = new Parser(new Lexer( + new StructureProvider() + .CreateStructure(), + new TextCoordinateSystemComputer())); [Theory] [ClassData(typeof(ParserSuccessTestData))] diff --git a/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs b/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs new file mode 100644 index 00000000..c9f5fe1f --- /dev/null +++ b/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs @@ -0,0 +1,47 @@ +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using Xunit; + +namespace HydraScript.Tests.Unit.FrontEnd; + +public class TextCoordinateSystemComputerTests +{ + private ITextCoordinateSystemComputer _sut = new TextCoordinateSystemComputer(); + + [Fact] + public void GetLines_NoNewLine_SingleIndexResult() + { + const string text = "let x = 0"; + var result = _sut.GetLines(text); + result.Should().BeEquivalentTo([text.Length + Environment.NewLine.Length - 1]); + } + + [Fact] + public void GetLines_HasNewLine_SingleIndexResult() + { + var text = "let x = 0" + Environment.NewLine; + var result = _sut.GetLines(text); + result.Should().BeEquivalentTo([text.Length - 1]); + } + + [Fact] + public void GetLines_HasNewLines_MultipleIndicesResult() + { + const string stmt1 = "let x = 0"; + const string stmt2 = "x = x + 1"; + const string stmt3 = """print("x")"""; + var text = stmt1 + + Environment.NewLine + + stmt2 + + Environment.NewLine + + stmt3 + + Environment.NewLine; + var result = _sut.GetLines(text); + result.Should().BeEquivalentTo( + [ + stmt1.Length + Environment.NewLine.Length - 1, + stmt1.Length + stmt2.Length + Environment.NewLine.Length * 2 - 1, + stmt1.Length + stmt2.Length + stmt3.Length + Environment.NewLine.Length * 3 - 1 + ]); + } +} \ No newline at end of file diff --git a/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs index e0e40edc..23021472 100644 --- a/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs +++ b/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs @@ -34,7 +34,11 @@ public void CertainLexerProvidedTest(SystemType lexerType, bool dump) InputFilePath = "file.js" }); - var lexerProvider = new LexerProvider(structureProvider.Object, Mock.Of(), options.Object); + var lexerProvider = new LexerProvider( + structureProvider.Object, + Mock.Of(), + Mock.Of(), + options.Object); var lexer = lexerProvider.CreateLexer(); Assert.IsType(lexerType, lexer); diff --git a/HydraScript/Program.cs b/HydraScript/Program.cs index 2c4b1b21..749de194 100644 --- a/HydraScript/Program.cs +++ b/HydraScript/Program.cs @@ -1,6 +1,8 @@ using System.Diagnostics.CodeAnalysis; using System.IO.Abstractions; using CommandLine; +using HydraScript.Lib.FrontEnd.GetTokens; +using HydraScript.Lib.FrontEnd.GetTokens.Impl; using HydraScript.Services.Executor; using HydraScript.Services.Executor.Impl; using HydraScript.Services.Parsing; @@ -44,6 +46,7 @@ private static void ConfigureServices(CommandLineSettings settings) ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); + ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); diff --git a/HydraScript/Services/Executor/Impl/Executor.cs b/HydraScript/Services/Executor/Impl/Executor.cs index df773642..cda12c8f 100644 --- a/HydraScript/Services/Executor/Impl/Executor.cs +++ b/HydraScript/Services/Executor/Impl/Executor.cs @@ -4,7 +4,6 @@ using HydraScript.Lib.FrontEnd.TopDownParse; using HydraScript.Lib.IR.CheckSemantics.Exceptions; using HydraScript.Services.SourceCode; -using Microsoft.Extensions.Options; namespace HydraScript.Services.Executor.Impl; diff --git a/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs index d1678e85..3a3c5271 100644 --- a/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs +++ b/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs @@ -9,15 +9,18 @@ namespace HydraScript.Services.Providers.LexerProvider.Impl; public class LexerProvider : ILexerProvider { private readonly IStructureProvider _structureProvider; + private readonly ITextCoordinateSystemComputer _computer; private readonly IFileSystem _fileSystem; private readonly CommandLineSettings _settings; public LexerProvider( IStructureProvider structureProvider, + ITextCoordinateSystemComputer computer, IFileSystem fileSystem, IOptions options) { _structureProvider = structureProvider; + _computer = computer; _fileSystem = fileSystem; _settings = options.Value; } @@ -25,7 +28,7 @@ public LexerProvider( public ILexer CreateLexer() { var structure = _structureProvider.CreateStructure(); - var lexer = new Lexer(structure); + var lexer = new Lexer(structure, _computer); var inputFileName = _settings.InputFilePath.Split(".js")[0]; return _settings.Dump ? new LoggingLexer(lexer, inputFileName, _fileSystem) From 2bffd2af82b0968c1e7c97d76f134d5463ba691f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Fri, 26 Jul 2024 00:28:01 +0300 Subject: [PATCH 10/35] =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D0=BD=D0=B3=20=D1=81=D1=82=D1=80=D1=83=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D1=80=D1=8B=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B0=20(#68)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #31 - non code elements * #31 - samples * #31 - structure refac * #31 - one more file --- .github/workflows/develop.yml | 6 +- .github/workflows/release.yml | 2 +- ExtendedJavaScriptSubset.sln | 78 +- .../BackEnd/AddressedInstructions.cs | 0 .../BackEnd/Addresses/HashAddress.cs | 0 .../BackEnd/Addresses/IAddress.cs | 0 .../BackEnd/Addresses/Label.cs | 0 .../BackEnd/Instructions/BlockLabel.cs | 0 .../BackEnd/Instructions/Halt.cs | 0 .../BackEnd/Instructions/Instruction.cs | 0 .../BackEnd/Instructions/Print.cs | 0 .../BackEnd/Instructions/PushParameter.cs | 0 .../BackEnd/Instructions/RemoveFromArray.cs | 0 .../BackEnd/Instructions/Return.cs | 0 .../Instructions/WithAssignment/AsString.cs | 0 .../WithAssignment/CallFunction.cs | 0 .../ComplexData/Create/CreateArray.cs | 0 .../ComplexData/Create/CreateObject.cs | 0 .../ComplexData/Read/DotRead.cs | 0 .../ComplexData/Read/IReadFromComplexData.cs | 0 .../ComplexData/Read/IndexRead.cs | 0 .../ComplexData/Write/DotAssignment.cs | 0 .../ComplexData/Write/IWriteToComplexData.cs | 0 .../ComplexData/Write/IndexAssignment.cs | 0 .../Instructions/WithAssignment/Simple.cs | 0 .../BackEnd/Instructions/WithJump/Goto.cs | 0 .../Instructions/WithJump/IfNotGoto.cs | 0 .../BackEnd/Values/Constant.cs | 0 .../HydraScript.Lib}/BackEnd/Values/IValue.cs | 0 .../HydraScript.Lib}/BackEnd/Values/Name.cs | 0 .../BackEnd/VirtualMachine.cs | 0 .../FrontEnd/GetTokens/Data/Structure.cs | 0 .../FrontEnd/GetTokens/Data/Token.cs | 0 .../Data/TokenTypes/EndOfProgramType.cs | 0 .../GetTokens/Data/TokenTypes/ErrorType.cs | 0 .../Data/TokenTypes/IgnorableType.cs | 0 .../GetTokens/Data/TokenTypes/TokenType.cs | 0 .../FrontEnd/GetTokens/ILexer.cs | 0 .../ITextCoordinateSystemComputer.cs | 0 .../FrontEnd/GetTokens/Impl/Lexer.cs | 0 .../Impl/TextCoordinateSystemComputer.cs | 0 .../FrontEnd/GetTokens/LexerException.cs | 0 .../FrontEnd/TopDownParse/IParser.cs | 0 .../FrontEnd/TopDownParse/Impl/Parser.cs | 0 .../TopDownParse/Impl/TokensStream.cs | 0 .../FrontEnd/TopDownParse/ParserException.cs | 0 .../HydraScript.Lib}/GlobalUsings.cs | 0 .../HydraScript.Lib}/HydraScript.Lib.csproj | 0 .../IR/Ast/AbstractSyntaxTreeNode.cs | 0 .../IR/Ast/IAbstractSyntaxTree.cs | 0 .../IR/Ast/Impl/AbstractSyntaxTree.cs | 0 .../AfterTypesAreLoadedDeclaration.cs | 0 .../FunctionDeclaration.cs | 0 .../AfterTypesAreLoaded/LexicalDeclaration.cs | 0 .../Nodes/Declarations/TypeDeclaration.cs | 0 .../Ast/Impl/Nodes/Declarations/TypeValue.cs | 0 .../AccessExpressions/AccessExpression.cs | 0 .../AccessExpressions/DotAccess.cs | 0 .../AccessExpressions/IndexAccess.cs | 0 .../Nodes/Expressions/AssignmentExpression.cs | 0 .../Nodes/Expressions/BinaryExpression.cs | 0 .../Impl/Nodes/Expressions/CallExpression.cs | 0 .../Nodes/Expressions/CastAsExpression.cs | 0 .../ComplexLiterals/ArrayLiteral.cs | 0 .../ComplexLiterals/ComplexLiteral.cs | 0 .../ComplexLiterals/ObjectLiteral.cs | 0 .../Expressions/ComplexLiterals/Property.cs | 0 .../Expressions/ConditionalExpression.cs | 0 .../Ast/Impl/Nodes/Expressions/Expression.cs | 0 .../Expressions/LeftHandSideExpression.cs | 0 .../Nodes/Expressions/MemberExpression.cs | 0 .../PrimaryExpressions/IdentifierReference.cs | 0 .../PrimaryExpressions/ImplicitLiteral.cs | 0 .../Expressions/PrimaryExpressions/Literal.cs | 0 .../PrimaryExpressions/PrimaryExpression.cs | 0 .../Impl/Nodes/Expressions/UnaryExpression.cs | 0 .../IR/Ast/Impl/Nodes/ScriptBody.cs | 0 .../IR/Ast/Impl/Nodes/StatementListItem.cs | 0 .../Impl/Nodes/Statements/BlockStatement.cs | 0 .../Nodes/Statements/ExpressionStatement.cs | 0 .../Ast/Impl/Nodes/Statements/IfStatement.cs | 0 .../Nodes/Statements/InsideStatementJump.cs | 0 .../Impl/Nodes/Statements/ReturnStatement.cs | 0 .../Impl/Nodes/Statements/WhileStatement.cs | 0 .../Visitors/ExpressionInstructionProvider.cs | 0 .../IR/Ast/Visitors/InstructionProvider.cs | 0 .../Exceptions/ArrayAccessException.cs | 0 .../Exceptions/AssignmentToConst.cs | 0 .../Exceptions/CannotDefineType.cs | 0 .../Exceptions/ConstWithoutInitializer.cs | 0 .../Exceptions/DeclarationAlreadyExists.cs | 0 .../FunctionWithoutReturnStatement.cs | 0 .../Exceptions/IncompatibleTypesOfOperands.cs | 0 .../Exceptions/NonAccessibleType.cs | 0 .../Exceptions/NotBooleanTestExpression.cs | 0 .../Exceptions/ObjectAccessException.cs | 0 .../Exceptions/OutsideOfStatement.cs | 0 .../Exceptions/ReturnOutsideFunction.cs | 0 .../Exceptions/SemanticException.cs | 0 .../Exceptions/SymbolIsNotCallable.cs | 0 .../Exceptions/UnknownIdentifierReference.cs | 0 .../Exceptions/UnsupportedOperation.cs | 0 .../WrongArrayLiteralDeclaration.cs | 0 .../Exceptions/WrongAssignmentTarget.cs | 0 .../Exceptions/WrongConditionalTypes.cs | 0 .../Exceptions/WrongNumberOfArguments.cs | 0 .../Exceptions/WrongReturnType.cs | 0 .../Exceptions/WrongTypeOfArgument.cs | 0 .../IR/CheckSemantics/Types/Any.cs | 0 .../IR/CheckSemantics/Types/ArrayType.cs | 0 .../IR/CheckSemantics/Types/NullType.cs | 0 .../IR/CheckSemantics/Types/NullableType.cs | 0 .../IR/CheckSemantics/Types/ObjectType.cs | 0 .../IR/CheckSemantics/Types/Type.cs | 0 .../CheckSemantics/Variables/SymbolTable.cs | 0 .../Variables/Symbols/FunctionSymbol.cs | 0 .../Variables/Symbols/ObjectSymbol.cs | 0 .../Variables/Symbols/Symbol.cs | 0 .../Variables/Symbols/TypeSymbol.cs | 0 .../Variables/Symbols/VariableSymbol.cs | 0 .../Visitors/DeclarationVisitor.cs | 0 .../Visitors/SemanticChecker.cs | 0 .../IDefaultValueForTypeCalculator.cs | 0 .../IFunctionWithUndefinedReturnStorage.cs | 0 .../Services/IJavaScriptTypesProvider.cs | 0 .../Visitors/Services/IMethodStorage.cs | 0 .../Services/IStandardLibraryProvider.cs | 0 .../ISymbolTableInitializerService.cs | 0 .../Services/ITypeDeclarationsResolver.cs | 0 .../Impl/DefaultValueForTypeCalculator.cs | 0 .../FunctionWithUndefinedReturnStorage.cs | 0 .../Services/Impl/JavaScriptTypesProvider.cs | 0 .../Visitors/Services/Impl/MethodStorage.cs | 0 .../Services/Impl/StandardLibraryProvider.cs | 0 .../Impl/SymbolTableInitializerService.cs | 0 .../Services/Impl/TypeDeclarationsResolver.cs | 0 .../Visitors/SymbolTableInitializer.cs | 0 .../Visitors/TypeSystemLoader.cs | 0 .../HydraScript}/CommandLineSettings.cs | 0 .../HydraScript}/HydraScript.csproj | 0 {HydraScript => src/HydraScript}/Program.cs | 0 .../Services/Executor/IExecutor.cs | 0 .../Services/Executor/Impl/Executor.cs | 0 .../Services/Parsing/IParsingService.cs | 0 .../Services/Parsing/Impl/ParsingService.cs | 0 .../Providers/LexerProvider/ILexerProvider.cs | 0 .../LexerProvider/Impl/LexerProvider.cs | 0 .../LexerProvider/Impl/LoggingLexer.cs | 0 .../ParserProvider/IParserProvider.cs | 0 .../Impl/LoggingAbstractSyntaxTree.cs | 0 .../ParserProvider/Impl/LoggingParser.cs | 0 .../ParserProvider/Impl/ParserProvider.cs | 0 .../StructureProvider/IStructureProvider.cs | 0 .../Impl/StructureProvider.cs | 0 .../SourceCode/ISourceCodeProvider.cs | 0 .../SourceCode/Impl/SourceCodeProvider.cs | 0 .../HydraScript}/TokenTypes.cs | 0 {HydraScript => src/HydraScript}/grammar.txt | 0 .../HydraScript.Tests}/GlobalUsings.cs | 0 .../Helpers/ListExtensions.cs | 0 .../Helpers/MockExtensions.cs | 0 .../HydraScript.Tests.csproj | 4 +- .../Properties/AssemblyInfo.cs | 0 .../Stubs/SemanticExceptionStub.cs | 0 .../TestData/InstructionsData.cs | 0 .../HydraScript.Tests}/TestData/LexerData.cs | 0 .../HydraScript.Tests}/TestData/ParserData.cs | 0 .../BackEnd/AddressedInstructionsTests.cs | 0 .../Unit/BackEnd/CallTests.cs | 0 .../Unit/BackEnd/HashAddressTests.cs | 0 .../Unit/BackEnd/InstructionsTests.cs | 0 .../Unit/BackEnd/ValuesTests.cs | 0 .../Unit/BackEnd/VirtualMachineTests.cs | 0 .../Unit/FrontEnd/LexerTests.cs | 0 .../Unit/FrontEnd/ParserTests.cs | 0 .../Unit/FrontEnd/StructureTests.cs | 0 .../TextCoordinateSystemComputerTests.cs | 0 .../Unit/IR/AstNodeTests.cs | 0 ...FunctionWithUndefinedReturnStorageTests.cs | 0 .../Unit/IR/SymbolTableTests.cs | 0 .../Unit/IR/Types/ObjectTypeTests.cs | 0 .../Unit/IR/Types/TypeTests.cs | 0 .../Unit/Infrastructure/ExecutorTests.cs | 0 .../Infrastructure/LoggingEntitiesTests.cs | 0 .../Infrastructure/ParsingServiceTests.cs | 0 .../Unit/Infrastructure/ProvidersTests.cs | 0 .../HydraScript.Tests/coverage.cobertura.xml | 10464 ++++++++++++++++ 187 files changed, 10545 insertions(+), 9 deletions(-) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/AddressedInstructions.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Addresses/HashAddress.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Addresses/IAddress.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Addresses/Label.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/BlockLabel.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/Halt.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/Instruction.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/Print.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/PushParameter.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/RemoveFromArray.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/Return.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/AsString.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/CallFunction.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithAssignment/Simple.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithJump/Goto.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Instructions/WithJump/IfNotGoto.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Values/Constant.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Values/IValue.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/Values/Name.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/BackEnd/VirtualMachine.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/Structure.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/Token.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/ILexer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Impl/Lexer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/GetTokens/LexerException.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/TopDownParse/IParser.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/TopDownParse/Impl/Parser.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/TopDownParse/Impl/TokensStream.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/FrontEnd/TopDownParse/ParserException.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/GlobalUsings.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/HydraScript.Lib.csproj (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/AbstractSyntaxTreeNode.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/IAbstractSyntaxTree.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/AbstractSyntaxTree.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/Expression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/ScriptBody.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/StatementListItem.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/IfStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Visitors/ExpressionInstructionProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/Ast/Visitors/InstructionProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/ArrayAccessException.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/AssignmentToConst.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/CannotDefineType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/NonAccessibleType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/ObjectAccessException.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/SemanticException.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongReturnType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/Any.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/ArrayType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/NullType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/NullableType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/ObjectType.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Types/Type.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/SymbolTable.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/Symbol.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/DeclarationVisitor.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/SemanticChecker.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs (100%) rename {HydraScript.Lib => src/HydraScript.Lib}/IR/CheckSemantics/Visitors/TypeSystemLoader.cs (100%) rename {HydraScript => src/HydraScript}/CommandLineSettings.cs (100%) rename {HydraScript => src/HydraScript}/HydraScript.csproj (100%) rename {HydraScript => src/HydraScript}/Program.cs (100%) rename {HydraScript => src/HydraScript}/Services/Executor/IExecutor.cs (100%) rename {HydraScript => src/HydraScript}/Services/Executor/Impl/Executor.cs (100%) rename {HydraScript => src/HydraScript}/Services/Parsing/IParsingService.cs (100%) rename {HydraScript => src/HydraScript}/Services/Parsing/Impl/ParsingService.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/LexerProvider/ILexerProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/LexerProvider/Impl/LexerProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/LexerProvider/Impl/LoggingLexer.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/ParserProvider/IParserProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/ParserProvider/Impl/LoggingParser.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/ParserProvider/Impl/ParserProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/StructureProvider/IStructureProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/Providers/StructureProvider/Impl/StructureProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/SourceCode/ISourceCodeProvider.cs (100%) rename {HydraScript => src/HydraScript}/Services/SourceCode/Impl/SourceCodeProvider.cs (100%) rename {HydraScript => src/HydraScript}/TokenTypes.cs (100%) rename {HydraScript => src/HydraScript}/grammar.txt (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/GlobalUsings.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Helpers/ListExtensions.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Helpers/MockExtensions.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/HydraScript.Tests.csproj (90%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Properties/AssemblyInfo.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Stubs/SemanticExceptionStub.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/TestData/InstructionsData.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/TestData/LexerData.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/TestData/ParserData.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/AddressedInstructionsTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/CallTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/HashAddressTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/InstructionsTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/ValuesTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/BackEnd/VirtualMachineTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/FrontEnd/LexerTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/FrontEnd/ParserTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/FrontEnd/StructureTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/IR/AstNodeTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/IR/SymbolTableTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/IR/Types/ObjectTypeTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/IR/Types/TypeTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/Infrastructure/ExecutorTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/Infrastructure/LoggingEntitiesTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/Infrastructure/ParsingServiceTests.cs (100%) rename {HydraScript.Tests => tests/HydraScript.Tests}/Unit/Infrastructure/ProvidersTests.cs (100%) create mode 100644 tests/HydraScript.Tests/coverage.cobertura.xml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index b899ca50..100370ab 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -43,7 +43,7 @@ jobs: if: github.event_name == 'pull_request_target' uses: 5monkeys/cobertura-action@master with: - path: ./HydraScript.Tests/coverage.cobertura.xml + path: ./tests/HydraScript.Tests/coverage.cobertura.xml repo_token: ${{ secrets.GITHUB_TOKEN }} minimum_coverage: 20 fail_below_threshold: true @@ -56,7 +56,7 @@ jobs: if: github.ref == 'refs/heads/master' && github.event_name == 'push' uses: irongut/CodeCoverageSummary@v1.3.0 with: - filename: ./HydraScript.Tests/coverage.cobertura.xml + filename: ./tests/HydraScript.Tests/coverage.cobertura.xml badge: true fail_below_min: false format: markdown @@ -66,7 +66,7 @@ jobs: - name: ReportGenerator uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 with: - reports: './HydraScript.Tests/coverage.cobertura.xml' + reports: './tests/HydraScript.Tests/coverage.cobertura.xml' targetdir: './coverage-report' - name: Upload coverage report artifact if: github.event_name == 'push' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8469d9ae..277f5c4d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: - name: Publish run: | mkdir output - dotnet publish ./HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output + dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output - name: Upload release assets uses: shogo82148/actions-upload-release-asset@v1 with: diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index 6257864f..67301016 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -1,10 +1,74 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Lib", "HydraScript.Lib\HydraScript.Lib.csproj", "{83524079-4A56-4AF0-9011-F7CA871536E9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Lib", "src\HydraScript.Lib\HydraScript.Lib.csproj", "{83524079-4A56-4AF0-9011-F7CA871536E9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript", "HydraScript\HydraScript.csproj", "{5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript", "src\HydraScript\HydraScript.csproj", "{5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Tests", "HydraScript.Tests\HydraScript.Tests.csproj", "{F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Tests", "tests\HydraScript.Tests\HydraScript.Tests.csproj", "{F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{86CF2A2F-4DFE-48E7-B062-EF824730916A}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md + CONTRIBUTING.md = CONTRIBUTING.md + contributor-licence-agreement.md = contributor-licence-agreement.md + LICENSE = LICENSE + Readme.md = Readme.md + SECURITY.md = SECURITY.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolder", "{54CBE5A7-3C3E-44ED-B877-7B08A818083B}" + ProjectSection(SolutionItems) = preProject + .github\pull_request_template.md = .github\pull_request_template.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}" + ProjectSection(SolutionItems) = preProject + .github\workflows\cla.yml = .github\workflows\cla.yml + .github\workflows\develop.yml = .github\workflows\develop.yml + .github\workflows\release.yml = .github\workflows\release.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplate", "IssueTemplate", "{0E31199C-4893-4920-A356-D1FF7850BFAD}" + ProjectSection(SolutionItems) = preProject + .github\ISSUE_TEMPLATE\bug_report.md = .github\ISSUE_TEMPLATE\bug_report.md + .github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{04ABBF20-AD95-4366-8EDE-57095A37735E}" + ProjectSection(SolutionItems) = preProject + samples\abs.js = samples\abs.js + samples\arraddremove.js = samples\arraddremove.js + samples\arreditread.js = samples\arreditread.js + samples\ceil.js = samples\ceil.js + samples\defaultarray.js = samples\defaultarray.js + samples\equals.js = samples\equals.js + samples\exprtest.js = samples\exprtest.js + samples\fastpow.js = samples\fastpow.js + samples\forwardref.js = samples\forwardref.js + samples\gcd.js = samples\gcd.js + samples\lcm.js = samples\lcm.js + samples\linkedlist.js = samples\linkedlist.js + samples\objeditread.js = samples\objeditread.js + samples\posneg.js = samples\posneg.js + samples\prime.js = samples\prime.js + samples\primefactor.js = samples\primefactor.js + samples\quicksort.js = samples\quicksort.js + samples\range.js = samples\range.js + samples\recur.js = samples\recur.js + samples\searchinll.js = samples\searchinll.js + samples\settable.js = samples\settable.js + samples\squareroot.js = samples\squareroot.js + samples\summator.js = samples\summator.js + samples\tern.js = samples\tern.js + samples\this.js = samples\this.js + samples\typeresolving.js = samples\typeresolving.js + samples\vec2d.js = samples\vec2d.js + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-1942-46D6-954E-9A1647BBDF10}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{3F131901-A9EC-451A-B7E9-726887CFE5FB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,4 +89,12 @@ Global {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {54CBE5A7-3C3E-44ED-B877-7B08A818083B} = {86CF2A2F-4DFE-48E7-B062-EF824730916A} + {C7773DC6-9052-4F69-B947-CBFD5D663E80} = {54CBE5A7-3C3E-44ED-B877-7B08A818083B} + {0E31199C-4893-4920-A356-D1FF7850BFAD} = {54CBE5A7-3C3E-44ED-B877-7B08A818083B} + {5DA79C0C-2B98-4E64-81EA-92AFFC5204D3} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} + {83524079-4A56-4AF0-9011-F7CA871536E9} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} + {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B} = {3F131901-A9EC-451A-B7E9-726887CFE5FB} + EndGlobalSection EndGlobal diff --git a/HydraScript.Lib/BackEnd/AddressedInstructions.cs b/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs similarity index 100% rename from HydraScript.Lib/BackEnd/AddressedInstructions.cs rename to src/HydraScript.Lib/BackEnd/AddressedInstructions.cs diff --git a/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs b/src/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Addresses/HashAddress.cs rename to src/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs diff --git a/HydraScript.Lib/BackEnd/Addresses/IAddress.cs b/src/HydraScript.Lib/BackEnd/Addresses/IAddress.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Addresses/IAddress.cs rename to src/HydraScript.Lib/BackEnd/Addresses/IAddress.cs diff --git a/HydraScript.Lib/BackEnd/Addresses/Label.cs b/src/HydraScript.Lib/BackEnd/Addresses/Label.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Addresses/Label.cs rename to src/HydraScript.Lib/BackEnd/Addresses/Label.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs b/src/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs rename to src/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/Halt.cs b/src/HydraScript.Lib/BackEnd/Instructions/Halt.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/Halt.cs rename to src/HydraScript.Lib/BackEnd/Instructions/Halt.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/Instruction.cs b/src/HydraScript.Lib/BackEnd/Instructions/Instruction.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/Instruction.cs rename to src/HydraScript.Lib/BackEnd/Instructions/Instruction.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/Print.cs b/src/HydraScript.Lib/BackEnd/Instructions/Print.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/Print.cs rename to src/HydraScript.Lib/BackEnd/Instructions/Print.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs b/src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/PushParameter.cs rename to src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs b/src/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs rename to src/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/Return.cs b/src/HydraScript.Lib/BackEnd/Instructions/Return.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/Return.cs rename to src/HydraScript.Lib/BackEnd/Instructions/Return.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs diff --git a/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs rename to src/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs diff --git a/HydraScript.Lib/BackEnd/Values/Constant.cs b/src/HydraScript.Lib/BackEnd/Values/Constant.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Values/Constant.cs rename to src/HydraScript.Lib/BackEnd/Values/Constant.cs diff --git a/HydraScript.Lib/BackEnd/Values/IValue.cs b/src/HydraScript.Lib/BackEnd/Values/IValue.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Values/IValue.cs rename to src/HydraScript.Lib/BackEnd/Values/IValue.cs diff --git a/HydraScript.Lib/BackEnd/Values/Name.cs b/src/HydraScript.Lib/BackEnd/Values/Name.cs similarity index 100% rename from HydraScript.Lib/BackEnd/Values/Name.cs rename to src/HydraScript.Lib/BackEnd/Values/Name.cs diff --git a/HydraScript.Lib/BackEnd/VirtualMachine.cs b/src/HydraScript.Lib/BackEnd/VirtualMachine.cs similarity index 100% rename from HydraScript.Lib/BackEnd/VirtualMachine.cs rename to src/HydraScript.Lib/BackEnd/VirtualMachine.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs diff --git a/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs rename to src/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs rename to src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs rename to src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs rename to src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs diff --git a/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs similarity index 100% rename from HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs rename to src/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs diff --git a/HydraScript.Lib/GlobalUsings.cs b/src/HydraScript.Lib/GlobalUsings.cs similarity index 100% rename from HydraScript.Lib/GlobalUsings.cs rename to src/HydraScript.Lib/GlobalUsings.cs diff --git a/HydraScript.Lib/HydraScript.Lib.csproj b/src/HydraScript.Lib/HydraScript.Lib.csproj similarity index 100% rename from HydraScript.Lib/HydraScript.Lib.csproj rename to src/HydraScript.Lib/HydraScript.Lib.csproj diff --git a/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs rename to src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs diff --git a/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs b/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs rename to src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs rename to src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs diff --git a/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs rename to src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs diff --git a/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs rename to src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs diff --git a/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs similarity index 100% rename from HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs rename to src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/Any.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs b/src/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Types/Type.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs diff --git a/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs similarity index 100% rename from HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs diff --git a/HydraScript/CommandLineSettings.cs b/src/HydraScript/CommandLineSettings.cs similarity index 100% rename from HydraScript/CommandLineSettings.cs rename to src/HydraScript/CommandLineSettings.cs diff --git a/HydraScript/HydraScript.csproj b/src/HydraScript/HydraScript.csproj similarity index 100% rename from HydraScript/HydraScript.csproj rename to src/HydraScript/HydraScript.csproj diff --git a/HydraScript/Program.cs b/src/HydraScript/Program.cs similarity index 100% rename from HydraScript/Program.cs rename to src/HydraScript/Program.cs diff --git a/HydraScript/Services/Executor/IExecutor.cs b/src/HydraScript/Services/Executor/IExecutor.cs similarity index 100% rename from HydraScript/Services/Executor/IExecutor.cs rename to src/HydraScript/Services/Executor/IExecutor.cs diff --git a/HydraScript/Services/Executor/Impl/Executor.cs b/src/HydraScript/Services/Executor/Impl/Executor.cs similarity index 100% rename from HydraScript/Services/Executor/Impl/Executor.cs rename to src/HydraScript/Services/Executor/Impl/Executor.cs diff --git a/HydraScript/Services/Parsing/IParsingService.cs b/src/HydraScript/Services/Parsing/IParsingService.cs similarity index 100% rename from HydraScript/Services/Parsing/IParsingService.cs rename to src/HydraScript/Services/Parsing/IParsingService.cs diff --git a/HydraScript/Services/Parsing/Impl/ParsingService.cs b/src/HydraScript/Services/Parsing/Impl/ParsingService.cs similarity index 100% rename from HydraScript/Services/Parsing/Impl/ParsingService.cs rename to src/HydraScript/Services/Parsing/Impl/ParsingService.cs diff --git a/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs b/src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs similarity index 100% rename from HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs rename to src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs diff --git a/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs b/src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs similarity index 100% rename from HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs rename to src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs diff --git a/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs b/src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs similarity index 100% rename from HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs rename to src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs diff --git a/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs b/src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs similarity index 100% rename from HydraScript/Services/Providers/ParserProvider/IParserProvider.cs rename to src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs diff --git a/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs similarity index 100% rename from HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs rename to src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs diff --git a/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs similarity index 100% rename from HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs rename to src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs diff --git a/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs similarity index 100% rename from HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs rename to src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs diff --git a/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs b/src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs similarity index 100% rename from HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs rename to src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs diff --git a/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs b/src/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs similarity index 100% rename from HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs rename to src/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs diff --git a/HydraScript/Services/SourceCode/ISourceCodeProvider.cs b/src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs similarity index 100% rename from HydraScript/Services/SourceCode/ISourceCodeProvider.cs rename to src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs diff --git a/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs b/src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs similarity index 100% rename from HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs rename to src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs diff --git a/HydraScript/TokenTypes.cs b/src/HydraScript/TokenTypes.cs similarity index 100% rename from HydraScript/TokenTypes.cs rename to src/HydraScript/TokenTypes.cs diff --git a/HydraScript/grammar.txt b/src/HydraScript/grammar.txt similarity index 100% rename from HydraScript/grammar.txt rename to src/HydraScript/grammar.txt diff --git a/HydraScript.Tests/GlobalUsings.cs b/tests/HydraScript.Tests/GlobalUsings.cs similarity index 100% rename from HydraScript.Tests/GlobalUsings.cs rename to tests/HydraScript.Tests/GlobalUsings.cs diff --git a/HydraScript.Tests/Helpers/ListExtensions.cs b/tests/HydraScript.Tests/Helpers/ListExtensions.cs similarity index 100% rename from HydraScript.Tests/Helpers/ListExtensions.cs rename to tests/HydraScript.Tests/Helpers/ListExtensions.cs diff --git a/HydraScript.Tests/Helpers/MockExtensions.cs b/tests/HydraScript.Tests/Helpers/MockExtensions.cs similarity index 100% rename from HydraScript.Tests/Helpers/MockExtensions.cs rename to tests/HydraScript.Tests/Helpers/MockExtensions.cs diff --git a/HydraScript.Tests/HydraScript.Tests.csproj b/tests/HydraScript.Tests/HydraScript.Tests.csproj similarity index 90% rename from HydraScript.Tests/HydraScript.Tests.csproj rename to tests/HydraScript.Tests/HydraScript.Tests.csproj index 57194398..a9204265 100644 --- a/HydraScript.Tests/HydraScript.Tests.csproj +++ b/tests/HydraScript.Tests/HydraScript.Tests.csproj @@ -33,8 +33,8 @@ - - + + diff --git a/HydraScript.Tests/Properties/AssemblyInfo.cs b/tests/HydraScript.Tests/Properties/AssemblyInfo.cs similarity index 100% rename from HydraScript.Tests/Properties/AssemblyInfo.cs rename to tests/HydraScript.Tests/Properties/AssemblyInfo.cs diff --git a/HydraScript.Tests/Stubs/SemanticExceptionStub.cs b/tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs similarity index 100% rename from HydraScript.Tests/Stubs/SemanticExceptionStub.cs rename to tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs diff --git a/HydraScript.Tests/TestData/InstructionsData.cs b/tests/HydraScript.Tests/TestData/InstructionsData.cs similarity index 100% rename from HydraScript.Tests/TestData/InstructionsData.cs rename to tests/HydraScript.Tests/TestData/InstructionsData.cs diff --git a/HydraScript.Tests/TestData/LexerData.cs b/tests/HydraScript.Tests/TestData/LexerData.cs similarity index 100% rename from HydraScript.Tests/TestData/LexerData.cs rename to tests/HydraScript.Tests/TestData/LexerData.cs diff --git a/HydraScript.Tests/TestData/ParserData.cs b/tests/HydraScript.Tests/TestData/ParserData.cs similarity index 100% rename from HydraScript.Tests/TestData/ParserData.cs rename to tests/HydraScript.Tests/TestData/ParserData.cs diff --git a/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs diff --git a/HydraScript.Tests/Unit/BackEnd/CallTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/CallTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs diff --git a/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs diff --git a/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs diff --git a/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/ValuesTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs diff --git a/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs similarity index 100% rename from HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs rename to tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs diff --git a/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs similarity index 100% rename from HydraScript.Tests/Unit/FrontEnd/LexerTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs diff --git a/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs similarity index 100% rename from HydraScript.Tests/Unit/FrontEnd/ParserTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs diff --git a/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs similarity index 100% rename from HydraScript.Tests/Unit/FrontEnd/StructureTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs diff --git a/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs similarity index 100% rename from HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs diff --git a/HydraScript.Tests/Unit/IR/AstNodeTests.cs b/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs similarity index 100% rename from HydraScript.Tests/Unit/IR/AstNodeTests.cs rename to tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs diff --git a/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs b/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs similarity index 100% rename from HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs rename to tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs diff --git a/HydraScript.Tests/Unit/IR/SymbolTableTests.cs b/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs similarity index 100% rename from HydraScript.Tests/Unit/IR/SymbolTableTests.cs rename to tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs diff --git a/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs b/tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs similarity index 100% rename from HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs rename to tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs diff --git a/HydraScript.Tests/Unit/IR/Types/TypeTests.cs b/tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs similarity index 100% rename from HydraScript.Tests/Unit/IR/Types/TypeTests.cs rename to tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs diff --git a/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs similarity index 100% rename from HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs rename to tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs diff --git a/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs similarity index 100% rename from HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs rename to tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs diff --git a/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs similarity index 100% rename from HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs rename to tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs diff --git a/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs similarity index 100% rename from HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs rename to tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs diff --git a/tests/HydraScript.Tests/coverage.cobertura.xml b/tests/HydraScript.Tests/coverage.cobertura.xml new file mode 100644 index 00000000..500ad914 --- /dev/null +++ b/tests/HydraScript.Tests/coverage.cobertura.xml @@ -0,0 +1,10464 @@ + + + + C:\Users\Stepan\RiderProjects\hydrascript\src\ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From a3c6c8b589c4a3f8683eef754731636246b0a684 Mon Sep 17 00:00:00 2001 From: Stepami Date: Fri, 26 Jul 2024 00:33:54 +0300 Subject: [PATCH 11/35] rm cobertura --- .../HydraScript.Tests/coverage.cobertura.xml | 10464 ---------------- 1 file changed, 10464 deletions(-) delete mode 100644 tests/HydraScript.Tests/coverage.cobertura.xml diff --git a/tests/HydraScript.Tests/coverage.cobertura.xml b/tests/HydraScript.Tests/coverage.cobertura.xml deleted file mode 100644 index 500ad914..00000000 --- a/tests/HydraScript.Tests/coverage.cobertura.xml +++ /dev/null @@ -1,10464 +0,0 @@ - - - - C:\Users\Stepan\RiderProjects\hydrascript\src\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From af644d8a5624004fc795daf2e67f0a7da3566105 Mon Sep 17 00:00:00 2001 From: Stepami Date: Fri, 26 Jul 2024 00:35:27 +0300 Subject: [PATCH 12/35] new ignore rule --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c77b3da7..629f5fff 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ _UpgradeReport_Files [Pp]ackages +tests/**/coverage.cobertura.xml + Thumbs.db Desktop.ini .DS_Store \ No newline at end of file From 884deaebb60639ac47931c6cd10650e127d0e9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Fri, 26 Jul 2024 15:39:38 +0300 Subject: [PATCH 13/35] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20Visitor.NET=20(#69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * minor fix * #31 - visitor.NET upgrade --- Readme.md | 2 +- .../FrontEnd/GetTokens/Data/Token.cs | 2 +- .../GetTokens/Data/TokenTypes/TokenType.cs | 2 +- src/HydraScript.Lib/HydraScript.Lib.csproj | 3 +- .../IR/Ast/AbstractSyntaxTreeNode.cs | 31 ++------ .../IR/Ast/Impl/AbstractSyntaxTree.cs | 10 +-- .../AfterTypesAreLoadedDeclaration.cs | 5 +- .../FunctionDeclaration.cs | 18 +---- .../AfterTypesAreLoaded/LexicalDeclaration.cs | 25 +------ .../Nodes/Declarations/TypeDeclaration.cs | 11 +-- .../Ast/Impl/Nodes/Declarations/TypeValue.cs | 17 ++--- .../AccessExpressions/AccessExpression.cs | 5 +- .../AccessExpressions/DotAccess.cs | 12 +-- .../AccessExpressions/IndexAccess.cs | 13 +--- .../Nodes/Expressions/AssignmentExpression.cs | 12 +-- .../Nodes/Expressions/BinaryExpression.cs | 13 +--- .../Impl/Nodes/Expressions/CallExpression.cs | 12 +-- .../Nodes/Expressions/CastAsExpression.cs | 12 +-- .../ComplexLiterals/ArrayLiteral.cs | 13 +--- .../ComplexLiterals/ObjectLiteral.cs | 13 +--- .../Expressions/ComplexLiterals/Property.cs | 8 +- .../Expressions/ConditionalExpression.cs | 13 +--- .../Ast/Impl/Nodes/Expressions/Expression.cs | 12 +-- .../Nodes/Expressions/MemberExpression.cs | 12 +-- .../PrimaryExpressions/IdentifierReference.cs | 7 +- .../PrimaryExpressions/ImplicitLiteral.cs | 7 +- .../Expressions/PrimaryExpressions/Literal.cs | 11 +-- .../PrimaryExpressions/PrimaryExpression.cs | 8 +- .../Impl/Nodes/Expressions/UnaryExpression.cs | 13 +--- .../IR/Ast/Impl/Nodes/ScriptBody.cs | 19 +---- .../IR/Ast/Impl/Nodes/StatementListItem.cs | 6 +- .../Impl/Nodes/Statements/BlockStatement.cs | 16 +--- .../Nodes/Statements/ExpressionStatement.cs | 13 +--- .../Ast/Impl/Nodes/Statements/IfStatement.cs | 13 +--- .../Nodes/Statements/InsideStatementJump.cs | 20 +---- .../Impl/Nodes/Statements/ReturnStatement.cs | 13 +--- .../Impl/Nodes/Statements/WhileStatement.cs | 13 +--- .../Visitors/ExpressionInstructionProvider.cs | 40 +++++----- .../IR/Ast/Visitors/InstructionProvider.cs | 43 ++++++----- .../Visitors/DeclarationVisitor.cs | 13 ++-- .../Visitors/SemanticChecker.cs | 75 ++++++++++--------- .../Visitors/SymbolTableInitializer.cs | 19 +++-- .../Visitors/TypeSystemLoader.cs | 13 ++-- 43 files changed, 194 insertions(+), 444 deletions(-) diff --git a/Readme.md b/Readme.md index 08848aa1..6c56ca6c 100644 --- a/Readme.md +++ b/Readme.md @@ -167,7 +167,7 @@ let s = v2d as string После клонирования репозитория идём в папку проекта `HydraScript`. Там выполняем команду: -```dotnet publish -r -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ``` +```dotnet publish ./src/HydraScript/HydraScript.csproj -r -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ``` Список идентификаторов рантайма лежит [тут](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#windows-rids) diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs index 4c1112e1..2e614cde 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs +++ b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs @@ -21,7 +21,7 @@ public override string ToString() public record EndToken() : Token(new EndOfProgramType(), null!, null!) { - public override string ToString() => Type.ToString(); + public override string ToString() => Type.Tag; } [ExcludeFromCodeCoverage] diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs index d14c21cd..98e0ebfb 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs +++ b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs @@ -10,5 +10,5 @@ public record TokenType(string Tag, string Pattern, int Priority) public string GetNamedRegex() => $"(?<{Tag}>{Pattern})"; - public sealed override string ToString() => Tag; + public override string ToString() => Tag; } \ No newline at end of file diff --git a/src/HydraScript.Lib/HydraScript.Lib.csproj b/src/HydraScript.Lib/HydraScript.Lib.csproj index 49bd9e07..83689500 100644 --- a/src/HydraScript.Lib/HydraScript.Lib.csproj +++ b/src/HydraScript.Lib/HydraScript.Lib.csproj @@ -8,7 +8,8 @@ - + + diff --git a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs index 7a815441..b4ef320e 100644 --- a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs +++ b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs @@ -1,18 +1,12 @@ using System.Collections; -using HydraScript.Lib.BackEnd; using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.IR.Ast.Visitors; using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast; -public abstract class AbstractSyntaxTreeNode : IEnumerable, - IVisitable, - IVisitable, - IVisitable, - IVisitable, - IVisitable +public abstract class AbstractSyntaxTreeNode : + IEnumerable, + IVisitable { public AbstractSyntaxTreeNode? Parent { get; set; } @@ -55,23 +49,8 @@ public bool ChildOf() where T : AbstractSyntaxTreeNode IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - #region Visitors - - public virtual Unit Accept(SymbolTableInitializer visitor) => - visitor.Visit(this); - - public virtual Unit Accept(TypeSystemLoader visitor) => - visitor.Visit(this); - - public virtual Unit Accept(DeclarationVisitor visitor) => - visitor.Visit(this); - - public virtual Type Accept(SemanticChecker visitor) => - "undefined"; - - public abstract AddressedInstructions Accept(InstructionProvider visitor); - - #endregion + public virtual TReturn Accept(IVisitor visitor) => + visitor.DefaultVisit; protected abstract string NodeRepresentation(); diff --git a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs index 3d36f9d0..011dae26 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs @@ -10,12 +10,12 @@ public class AbstractSyntaxTree : IAbstractSyntaxTree { private readonly AbstractSyntaxTreeNode _root; - private readonly SymbolTableInitializer _symbolTableInitializer; - private readonly TypeSystemLoader _typeSystemLoader; - private readonly DeclarationVisitor _declarationVisitor; + private readonly IVisitor _symbolTableInitializer; + private readonly IVisitor _typeSystemLoader; + private readonly IVisitor _declarationVisitor; - private readonly SemanticChecker _semanticChecker; - private readonly InstructionProvider _instructionProvider; + private readonly IVisitor _semanticChecker; + private readonly IVisitor _instructionProvider; public AbstractSyntaxTree(AbstractSyntaxTreeNode root) { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs index 4feb4636..57261a54 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs @@ -1,8 +1,7 @@ -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; public abstract class AfterTypesAreLoadedDeclaration : Declaration { - public abstract override Unit Accept(DeclarationVisitor visitor); + public abstract override TReturn Accept( + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs index ceb2c634..947e7ced 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -1,12 +1,10 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -public class FunctionDeclaration : AfterTypesAreLoadedDeclaration +[AutoVisitable] +public partial class FunctionDeclaration : AfterTypesAreLoadedDeclaration { private IReadOnlyCollection? _returnStatements; @@ -48,16 +46,4 @@ public override IEnumerator GetEnumerator() protected override string NodeRepresentation() => "function " + Name; - - public override Unit Accept(SymbolTableInitializer visitor) => - visitor.Visit(this); - - public override Unit Accept(DeclarationVisitor visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs index 35fe9bea..4374f6d9 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs @@ -1,20 +1,12 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -public class LexicalDeclaration : AfterTypesAreLoadedDeclaration +[AutoVisitable] +public partial class LexicalDeclaration(bool readOnly) : AfterTypesAreLoadedDeclaration { - public bool ReadOnly { get; } - public List Assignments { get; } - - public LexicalDeclaration(bool readOnly) - { - ReadOnly = readOnly; - Assignments = new(); - } + public bool ReadOnly { get; } = readOnly; + public List Assignments { get; } = []; public void AddAssignment(AssignmentExpression assignment) { @@ -27,13 +19,4 @@ public override IEnumerator GetEnumerator() => protected override string NodeRepresentation() => ReadOnly ? "const" : "let"; - - public override Unit Accept(DeclarationVisitor visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs index bdb8a300..aef76c8e 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs @@ -1,11 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -public class TypeDeclaration : Declaration +[AutoVisitable] +public partial class TypeDeclaration : Declaration { private readonly TypeValue _typeValue; public IdentifierReference TypeId { get; } @@ -26,9 +24,4 @@ public override IEnumerator GetEnumerator() protected override string NodeRepresentation() => $"type {TypeId.Name} = {_typeValue}"; - - public override AddressedInstructions Accept(InstructionProvider visitor) => new(); - - public override Unit Accept(TypeSystemLoader visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs index bea24412..9f5c69aa 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs @@ -11,9 +11,7 @@ public abstract record TypeValue public abstract Type BuildType(SymbolTable symbolTable); } -public record TypeIdentValue( - IdentifierReference TypeId -) : TypeValue +public record TypeIdentValue(IdentifierReference TypeId) : TypeValue { public override Type BuildType(SymbolTable symbolTable) => symbolTable.FindSymbol(TypeId)?.Type ?? @@ -22,9 +20,7 @@ public override Type BuildType(SymbolTable symbolTable) => public override string ToString() => TypeId; } -public record ArrayTypeValue( - TypeValue TypeValue -) : TypeValue +public record ArrayTypeValue(TypeValue TypeValue) : TypeValue { public override Type BuildType(SymbolTable symbolTable) => new ArrayType(TypeValue.BuildType(symbolTable)); @@ -32,9 +28,7 @@ public override Type BuildType(SymbolTable symbolTable) => public override string ToString() => $"{TypeValue}[]"; } -public record NullableTypeValue( - TypeValue TypeValue -) : TypeValue +public record NullableTypeValue(TypeValue TypeValue) : TypeValue { public override Type BuildType(SymbolTable symbolTable) => new NullableType(TypeValue.BuildType(symbolTable)); @@ -48,11 +42,10 @@ public record PropertyTypeValue( { public override string ToString() => $"{Key}: {TypeValue}"; -}; +} public record ObjectTypeValue( - IEnumerable Properties -) : TypeValue + IEnumerable Properties) : TypeValue { public override Type BuildType(SymbolTable symbolTable) => new ObjectType( diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs index 31e3d4dc..8e2c8185 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs @@ -1,5 +1,3 @@ -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; public abstract class AccessExpression : Expression @@ -26,5 +24,6 @@ public bool HasNext() => public bool HasPrev() => Prev is not null; - public abstract override Type Accept(SemanticChecker visitor); + public abstract override TReturn Accept( + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs index 36be5133..bb9094ac 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -1,11 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -public class DotAccess : AccessExpression +[AutoVisitable] +public partial class DotAccess : AccessExpression { public IdentifierReference Property { get; } @@ -25,10 +23,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "."; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs index 08e6d4c1..4216f2b6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -public class IndexAccess : AccessExpression +[AutoVisitable] +public partial class IndexAccess : AccessExpression { public Expression Index { get; } @@ -24,10 +21,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "[]"; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs index f677e4aa..d41f5f2d 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs @@ -1,11 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class AssignmentExpression : Expression +[AutoVisitable] +public partial class AssignmentExpression : Expression { public LeftHandSideExpression Destination { get; } public Expression Source { get; } @@ -32,10 +30,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "="; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs index 07be9f14..bbebf623 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class BinaryExpression : Expression +[AutoVisitable] +public partial class BinaryExpression : Expression { public Expression Left { get; } public string Operator { get; } @@ -28,10 +25,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => Operator; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs index 8dacc95c..dca0bb29 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs @@ -1,11 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class CallExpression : LeftHandSideExpression +[AutoVisitable] +public partial class CallExpression : LeftHandSideExpression { public MemberExpression Member { get; } public List Parameters { get; } @@ -36,10 +34,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "()"; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs index 4ea335d6..4cf1e118 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs @@ -1,11 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class CastAsExpression : Expression +[AutoVisitable] +public partial class CastAsExpression : Expression { public Expression Expression { get; } public TypeValue Cast { get; } @@ -24,10 +22,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => $"as {Cast}"; - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs index 29d7c60d..2b301e6c 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -public class ArrayLiteral : ComplexLiteral +[AutoVisitable] +public partial class ArrayLiteral : ComplexLiteral { public List Expressions { get; } @@ -18,10 +15,4 @@ public override IEnumerator GetEnumerator() => Expressions.GetEnumerator(); protected override string NodeRepresentation() => "[]"; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs index be97943d..02a88dc0 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -public class ObjectLiteral : ComplexLiteral +[AutoVisitable] +public partial class ObjectLiteral : ComplexLiteral { public List Properties { get; } @@ -18,10 +15,4 @@ public override IEnumerator GetEnumerator() => Properties.GetEnumerator(); protected override string NodeRepresentation() => "{}"; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs index 2afcf034..adbf2691 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs @@ -1,10 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -public class Property : Expression +[AutoVisitable] +public partial class Property : Expression { public IdentifierReference Id { get; } public Expression Expression { get; } @@ -34,7 +33,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => ":"; - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs index 620de68b..0a0fafc6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class ConditionalExpression : Expression +[AutoVisitable] +public partial class ConditionalExpression : Expression { public Expression Test { get; } public Expression Consequent { get; } @@ -29,10 +26,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "?:"; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs index 9da02668..613ba9fa 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs @@ -1,13 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public abstract class Expression : AbstractSyntaxTreeNode, - IVisitable +public abstract class Expression : AbstractSyntaxTreeNode { - public abstract AddressedInstructions Accept(ExpressionInstructionProvider visitor); - - public sealed override AddressedInstructions Accept(InstructionProvider visitor) => - throw new NotSupportedException(); + public abstract override TReturn Accept( + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs index 9b7fe8f8..55206062 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs @@ -1,12 +1,10 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class MemberExpression : LeftHandSideExpression +[AutoVisitable] +public partial class MemberExpression : LeftHandSideExpression { private readonly IdentifierReference _identifierReference; @@ -53,10 +51,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => nameof(MemberExpression); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs index 07bc31bb..cc61ae9f 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs @@ -1,9 +1,9 @@ using HydraScript.Lib.BackEnd.Values; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public class IdentifierReference(string name) : PrimaryExpression +[AutoVisitable] +public partial class IdentifierReference(string name) : PrimaryExpression { public string Name { get; } = name; @@ -11,9 +11,6 @@ public class IdentifierReference(string name) : PrimaryExpression public override IValue ToValue() => new Name(Name); - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - public static implicit operator string(IdentifierReference identifierReference) => identifierReference.Name; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs index 42f26320..7d3d6df2 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs @@ -1,10 +1,10 @@ using HydraScript.Lib.BackEnd.Values; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public class ImplicitLiteral(TypeValue typeValue) : PrimaryExpression +[AutoVisitable] +public partial class ImplicitLiteral(TypeValue typeValue) : PrimaryExpression { public TypeValue TypeValue { get; } = typeValue; public object? ComputedDefaultValue { private get; set; } @@ -18,7 +18,4 @@ public override IValue ToValue() => ComputedDefaultValue is null ? "null" : ComputedDefaultValue.ToString()!); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs index b91ae3e4..358f31a6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs @@ -1,13 +1,13 @@ using HydraScript.Lib.BackEnd.Values; using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public class Literal : PrimaryExpression +[AutoVisitable] +public partial class Literal : PrimaryExpression { - private readonly TypeValue _type; + public TypeValue Type { get; } private readonly object? _value; private readonly string _label; @@ -17,7 +17,7 @@ public Literal( Segment segment, string? label = null) { - _type = type; + Type = type; _label = (label ?? value?.ToString())!; _value = value; Segment = segment; @@ -27,7 +27,4 @@ public Literal( public override IValue ToValue() => new Constant(_value, _label); - - public override Type Accept(SemanticChecker visitor) => - _type.BuildType(Parent!.SymbolTable); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs index 1ba91197..59b23fb6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs @@ -1,10 +1,9 @@ -using HydraScript.Lib.BackEnd; using HydraScript.Lib.BackEnd.Values; -using HydraScript.Lib.IR.Ast.Visitors; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -public abstract class PrimaryExpression : Expression +[AutoVisitable] +public abstract partial class PrimaryExpression : Expression { public override IEnumerator GetEnumerator() { @@ -12,7 +11,4 @@ public override IEnumerator GetEnumerator() } public abstract IValue ToValue(); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs index 8b486c90..553cebc6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -public class UnaryExpression : Expression +[AutoVisitable] +public partial class UnaryExpression : Expression { public string Operator { get; } public Expression Expression { get; } @@ -23,10 +20,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => Operator; - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(ExpressionInstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs index cfd21691..d1772bcd 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes; -public class ScriptBody : AbstractSyntaxTreeNode +[AutoVisitable] +public partial class ScriptBody : AbstractSyntaxTreeNode { public List StatementList { get; } @@ -18,16 +15,4 @@ public override IEnumerator GetEnumerator() => StatementList.GetEnumerator(); protected override string NodeRepresentation() => "Script"; - - public override Unit Accept(SymbolTableInitializer visitor) => - visitor.Visit(this); - - public override Unit Accept(TypeSystemLoader visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs index 7c277f50..dca2d3d4 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs @@ -1,10 +1,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes; public abstract class StatementListItem : - AbstractSyntaxTreeNode { } + AbstractSyntaxTreeNode; public abstract class Statement : - StatementListItem { } + StatementListItem; public abstract class Declaration : - StatementListItem { } \ No newline at end of file + StatementListItem; \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs index 3feaca31..fee3b6a5 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class BlockStatement : Statement +[AutoVisitable] +public partial class BlockStatement : Statement { public List StatementList { get; } @@ -18,13 +15,4 @@ public override IEnumerator GetEnumerator() => StatementList.GetEnumerator(); protected override string NodeRepresentation() => "{}"; - - public override Unit Accept(SymbolTableInitializer visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs index c861c016..6fbfb516 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class ExpressionStatement : Statement +[AutoVisitable] +public partial class ExpressionStatement : Statement { public Expression Expression { get; } @@ -20,10 +17,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => nameof(ExpressionStatement); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs index 4bc356d9..3be48613 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class IfStatement : Statement +[AutoVisitable] +public partial class IfStatement : Statement { public Expression Test { get; } public Statement Then { get; } @@ -42,10 +39,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "if"; - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs index b1517eef..26f47e1b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs @@ -1,20 +1,12 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class InsideStatementJump : Statement +[AutoVisitable] +public partial class InsideStatementJump(string keyword) : Statement { public const string Break = "break"; public const string Continue = "continue"; - public string Keyword { get; } - - public InsideStatementJump(string keyword) - { - Keyword = keyword; - } + public string Keyword { get; } = keyword; public override IEnumerator GetEnumerator() { @@ -22,10 +14,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => Keyword; - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs index ee8cf85b..44d4cb14 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class ReturnStatement : Statement +[AutoVisitable] +public partial class ReturnStatement : Statement { public Expression? Expression { get; } @@ -28,10 +25,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "return"; - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs index 4224a763..d9930095 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs @@ -1,10 +1,7 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -public class WhileStatement : Statement +[AutoVisitable] +public partial class WhileStatement : Statement { public Expression Condition { get; } public Statement Statement { get; } @@ -25,10 +22,4 @@ public override IEnumerator GetEnumerator() } protected override string NodeRepresentation() => "while"; - - public override AddressedInstructions Accept(InstructionProvider visitor) => - visitor.Visit(this); - - public override Type Accept(SemanticChecker visitor) => - visitor.Visit(this); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs index b3b5fe95..9d98e69f 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs +++ b/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs @@ -15,7 +15,7 @@ namespace HydraScript.Lib.IR.Ast.Visitors; -public class ExpressionInstructionProvider : +public class ExpressionInstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -51,7 +51,7 @@ public AddressedInstructions Visit(ArrayLiteral visitable) result.Add(new IndexAssignment(arrayName, index, primary.ToValue())); else { - result.AddRange(expression.Accept(this)); + result.AddRange(expression.Accept(This)); var last = new Name(result.OfType().Last().Left!); result.Add(new IndexAssignment(arrayName, index, last)); } @@ -69,7 +69,7 @@ public AddressedInstructions Visit(ObjectLiteral visitable) result.AddRange(visitable.Properties .SelectMany(property => - property.Accept(this))); + property.Accept(This))); return result; } @@ -84,7 +84,7 @@ public AddressedInstructions Visit(Property visitable) if (expression is PrimaryExpression primary) return [new DotAssignment(objectId, propertyId, primary.ToValue())]; - var instructions = expression.Accept(this); + var instructions = expression.Accept(This); var last = new Name(instructions.OfType().Last().Left!); instructions.Add(new DotAssignment(objectId, propertyId, last)); @@ -96,7 +96,7 @@ public AddressedInstructions Visit(UnaryExpression visitable) if (visitable.Expression is PrimaryExpression primary) return [new Simple(visitable.Operator, primary.ToValue())]; - var result = visitable.Expression.Accept(this); + var result = visitable.Expression.Accept(This); var last = new Name(result.OfType().Last().Left!); result.Add(new Simple(visitable.Operator, last)); @@ -115,7 +115,7 @@ public AddressedInstructions Visit(BinaryExpression visitable) left = primaryLeft.ToValue(); else { - result.AddRange(visitable.Left.Accept(this)); + result.AddRange(visitable.Left.Accept(This)); left = new Name(result.OfType().Last().Left!); } @@ -123,7 +123,7 @@ public AddressedInstructions Visit(BinaryExpression visitable) right = primaryRight.ToValue(); else { - result.AddRange(visitable.Right.Accept(this)); + result.AddRange(visitable.Right.Accept(This)); right = new Name(result.OfType().Last().Left!); } @@ -137,7 +137,7 @@ public AddressedInstructions Visit(CastAsExpression visitable) if (visitable.Expression is PrimaryExpression primary) return [new AsString(primary.ToValue())]; - var result = visitable.Expression.Accept(this); + var result = visitable.Expression.Accept(This); var last = new Name(result.OfType().Last().Left!); result.Add(new AsString(last)); @@ -156,17 +156,17 @@ public AddressedInstructions Visit(ConditionalExpression visitable) result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); else { - result.AddRange(visitable.Test.Accept(this)); + result.AddRange(visitable.Test.Accept(This)); var last = new Name(result.OfType().Last().Left!); result.Add(new IfNotGoto(last, startBlockLabel)); } - result.AddRange(visitable.Consequent.Accept(this)); + result.AddRange(visitable.Consequent.Accept(This)); var temp = result.OfType().Last().Left!; result.Add(new Goto(endBlockLabel)); result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); - result.AddRange(visitable.Alternate.Accept(this)); + result.AddRange(visitable.Alternate.Accept(This)); result.OfType().Last().Left = temp; result.Add(new EndBlock(BlockType.Condition, blockId), endBlockLabel.Name); @@ -177,7 +177,7 @@ public AddressedInstructions Visit(ConditionalExpression visitable) public AddressedInstructions Visit(AssignmentExpression visitable) { - var result = visitable.Source.Accept(this); + var result = visitable.Source.Accept(This); if (visitable.Source is AssignmentExpression) { var last = result.OfType().Last(); @@ -192,7 +192,7 @@ public AddressedInstructions Visit(AssignmentExpression visitable) else { var last = new Name(result.OfType().Last().Left!); - result.AddRange(visitable.Destination.Accept(this)); + result.AddRange(visitable.Destination.Accept(This)); var lastRead = result.OfType().Last(); result.Replace(lastRead.ToInstruction(), lastRead.ToAssignment(last)); } @@ -203,7 +203,7 @@ public AddressedInstructions Visit(AssignmentExpression visitable) public AddressedInstructions Visit(MemberExpression visitable) => visitable.Empty() ? [] - : visitable.Tail?.Accept(this) ?? []; + : visitable.Tail?.Accept(This) ?? []; public AddressedInstructions Visit(DotAccess visitable) { @@ -212,7 +212,7 @@ public AddressedInstructions Visit(DotAccess visitable) if (!visitable.HasPrev() && visitable.Parent is LeftHandSideExpression lhs) return [new DotRead(new Name(lhs.Id), right)]; - var result = visitable.Prev?.Accept(this) ?? []; + var result = visitable.Prev?.Accept(This) ?? []; var left = new Name(result.OfType().Last().Left!); result.Add(new DotRead(left, right)); @@ -229,7 +229,7 @@ public AddressedInstructions Visit(IndexAccess visitable) right = primary.ToValue(); else { - result.AddRange(visitable.Index.Accept(this)); + result.AddRange(visitable.Index.Accept(This)); right = new Name(result.OfType().Last().Left!); } @@ -237,7 +237,7 @@ public AddressedInstructions Visit(IndexAccess visitable) result.Add(new IndexRead(new Name(lhs.Id), right)); else { - result.AddRange(visitable.Prev?.Accept(this) ?? []); + result.AddRange(visitable.Prev?.Accept(This) ?? []); var left = new Name(result.OfType().Last().Left!); result.Add(new IndexRead(left, right)); } @@ -255,7 +255,7 @@ public AddressedInstructions Visit(CallExpression visitable) if (param is PrimaryExpression prim) return [new Print(prim.ToValue())]; - var result = param.Accept(this); + var result = param.Accept(This); var last = new Name(result.OfType().Last().Left!); result.Add(new Print(last)); @@ -267,7 +267,7 @@ public AddressedInstructions Visit(CallExpression visitable) AddressedInstructions result = []; if (methodCall) { - var memberInstructions = visitable.Member.Accept(this); + var memberInstructions = visitable.Member.Accept(This); var lastMemberInstruction = (DotRead)memberInstructions[memberInstructions.End]; memberInstructions.Remove(lastMemberInstruction); result.AddRange(memberInstructions); @@ -297,7 +297,7 @@ public AddressedInstructions Visit(CallExpression visitable) result.Add(new PushParameter(symbol.Id, primary.ToValue())); else { - result.AddRange(expr.Accept(this)); + result.AddRange(expr.Accept(This)); var id = result.OfType().Last().Left!; result.Add(new PushParameter(symbol.Id, new Name(id))); } diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs index fba62c24..d7f9f0e5 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs +++ b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs @@ -11,7 +11,7 @@ namespace HydraScript.Lib.IR.Ast.Visitors; -public class InstructionProvider : +public class InstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -22,21 +22,28 @@ public class InstructionProvider : IVisitor, IVisitor { - private readonly ExpressionInstructionProvider _expressionVisitor = new(); - + private readonly IVisitor _expressionVisitor; + + public InstructionProvider() + { + _expressionVisitor = new ExpressionInstructionProvider(); + } + public AddressedInstructions Visit(ScriptBody visitable) { var result = new AddressedInstructions(); foreach (var item in visitable.StatementList) { - result.AddRange(item.Accept(this)); + result.AddRange(item.Accept(This)); } result.Add(new Halt()); - + return result; } + public override AddressedInstructions DefaultVisit { get; } = []; + public AddressedInstructions Visit(LexicalDeclaration visitable) { var result = new AddressedInstructions(); @@ -53,7 +60,7 @@ public AddressedInstructions Visit(BlockStatement visitable) var result = new AddressedInstructions(); foreach (var item in visitable.StatementList) { - result.AddRange(item.Accept(this)); + result.AddRange(item.Accept(This)); if (item is ReturnStatement) break; } @@ -109,13 +116,13 @@ public AddressedInstructions Visit(FunctionDeclaration visitable) functionInfo.Start.Name } }; - - result.AddRange(visitable.Statements.Accept(this)); + + result.AddRange(visitable.Statements.Accept(This)); if (!visitable.HasReturnStatement()) result.Add(new Return()); result.Add(new EndBlock(BlockType.Function, blockId: functionInfo.ToString()), functionInfo.End.Name); - + return result; } @@ -124,7 +131,7 @@ public AddressedInstructions Visit(WhileStatement visitable) var blockId = $"while_{visitable.GetHashCode()}"; var startBlockLabel = new Label($"Start_{blockId}"); var endBlockLabel = new Label($"End_{blockId}"); - + var result = new AddressedInstructions { { new BeginBlock(BlockType.Loop, blockId), startBlockLabel.Name } @@ -138,8 +145,8 @@ public AddressedInstructions Visit(WhileStatement visitable) var last = new Name(result.OfType().Last().Left!); result.Add(new IfNotGoto(last, endBlockLabel)); } - - result.AddRange(visitable.Statement.Accept(this)); + + result.AddRange(visitable.Statement.Accept(This)); result.OfType().Where(g => g.JumpType is not null) .ToList().ForEach(g => { @@ -169,9 +176,9 @@ public AddressedInstructions Visit(IfStatement visitable) var blockId = $"if_else_{visitable.GetHashCode()}"; var startBlockLabel = new Label($"Start_{blockId}"); var endBlockLabel = new Label($"End_{blockId}"); - + var result = new AddressedInstructions(); - + if (visitable.Test is PrimaryExpression primary) result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); else @@ -184,16 +191,16 @@ public AddressedInstructions Visit(IfStatement visitable) : endBlockLabel) ); } - - result.AddRange(visitable.Then.Accept(this)); + + result.AddRange(visitable.Then.Accept(This)); result.Add(new Goto(endBlockLabel)); result.Add(new BeginBlock(BlockType.Condition, blockId), startBlockLabel.Name); if (visitable.HasElseBlock()) - result.AddRange(visitable.Else?.Accept(this) ?? []); + result.AddRange(visitable.Else?.Accept(This) ?? []); result.OfType().Where(g => g.JumpType is InsideStatementJumpType.Break) - .ToList().ForEach(g=> g.SetJump(endBlockLabel)); + .ToList().ForEach(g => g.SetJump(endBlockLabel)); result.Add(new EndBlock(BlockType.Condition, blockId), endBlockLabel.Name); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs index 1bb19bc2..41ce2efc 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs @@ -10,8 +10,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class DeclarationVisitor : - IVisitor, +public class DeclarationVisitor : VisitorNoReturnBase, IVisitor, IVisitor { @@ -26,15 +25,15 @@ public DeclarationVisitor( _methodStorage = methodStorage; } - public Unit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { foreach (var child in visitable) - child.Accept(this); + child.Accept(This); return default; } - public Unit Visit(LexicalDeclaration visitable) + public VisitUnit Visit(LexicalDeclaration visitable) { foreach (var assignment in visitable.Assignments) { @@ -59,7 +58,7 @@ public Unit Visit(LexicalDeclaration visitable) return default; } - public Unit Visit(FunctionDeclaration visitable) + public VisitUnit Visit(FunctionDeclaration visitable) { if (visitable.Parent!.SymbolTable.ContainsSymbol(visitable.Name)) throw new DeclarationAlreadyExists(visitable.Name); @@ -94,6 +93,6 @@ public Unit Visit(FunctionDeclaration visitable) } visitable.Parent.SymbolTable.AddSymbol(functionSymbol); - return visitable.Statements.Accept(this); + return visitable.Statements.Accept(This); } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs index 62c1b398..0d954eda 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs @@ -1,3 +1,4 @@ +using HydraScript.Lib.IR.Ast; using HydraScript.Lib.IR.Ast.Impl.Nodes; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; @@ -12,7 +13,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class SemanticChecker : +public class SemanticChecker : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -20,6 +21,7 @@ public class SemanticChecker : IVisitor, IVisitor, IVisitor, + IVisitor, IVisitor, IVisitor, IVisitor, @@ -50,38 +52,40 @@ public SemanticChecker( _methodStorage = methodStorage; } + public override Type DefaultVisit => "undefined"; + public Type Visit(ScriptBody visitable) { foreach (var statementListItem in visitable.StatementList) - statementListItem.Accept(this); + statementListItem.Accept(This); foreach (var funcDecl in _functionStorage.Flush()) - funcDecl.Accept(this); + funcDecl.Accept(This); return "undefined"; } public Type Visit(WhileStatement visitable) { - var condType = visitable.Condition.Accept(this); + var condType = visitable.Condition.Accept(This); Type boolean = "boolean"; if (!condType.Equals(boolean)) throw new NotBooleanTestExpression(visitable.Segment, condType); - visitable.Statement.Accept(this); + visitable.Statement.Accept(This); return "undefined"; } public Type Visit(IfStatement visitable) { - var testType = visitable.Test.Accept(this); + var testType = visitable.Test.Accept(This); Type boolean = "boolean"; if (!testType.Equals(boolean)) throw new NotBooleanTestExpression(visitable.Segment, testType); - visitable.Then.Accept(this); - visitable.Else?.Accept(this); + visitable.Then.Accept(This); + visitable.Else?.Accept(This); return "undefined"; } @@ -114,11 +118,11 @@ public Type Visit(ReturnStatement visitable) if (!visitable.ChildOf()) throw new ReturnOutsideFunction(visitable.Segment); - return visitable.Expression?.Accept(this) ?? "void"; + return visitable.Expression?.Accept(This) ?? "void"; } public Type Visit(ExpressionStatement visitable) => - visitable.Expression.Accept(this); + visitable.Expression.Accept(This); public Type Visit(IdentifierReference visitable) { @@ -126,6 +130,9 @@ public Type Visit(IdentifierReference visitable) return symbol?.Type ?? throw new UnknownIdentifierReference(visitable); } + public Type Visit(Literal visitable) => + visitable.Type.BuildType(visitable.Parent!.SymbolTable); + public Type Visit(ImplicitLiteral visitable) { var type = visitable.TypeValue.BuildType(visitable.Parent!.SymbolTable); @@ -138,8 +145,8 @@ public Type Visit(ArrayLiteral visitable) if (visitable.Expressions.Count == 0) return new ArrayType(new Any()); - var type = visitable.First().Accept(this); - if (visitable.Expressions.All(e => e.Accept(this).Equals(type))) + var type = visitable.First().Accept(This); + if (visitable.Expressions.All(e => e.Accept(This).Equals(type))) return new ArrayType(type); throw new WrongArrayLiteralDeclaration(visitable.Segment, type); @@ -149,7 +156,7 @@ public Type Visit(ObjectLiteral visitable) { var properties = visitable.Properties.Select(prop => { - var propType = prop.Expression.Accept(this); + var propType = prop.Expression.Accept(This); visitable.SymbolTable.AddSymbol(propType switch { ObjectType objectType => new ObjectSymbol(prop.Id, objectType), @@ -163,13 +170,13 @@ public Type Visit(ObjectLiteral visitable) public Type Visit(ConditionalExpression visitable) { - var tType = visitable.Test.Accept(this); + var tType = visitable.Test.Accept(This); Type boolean = "boolean"; if (!tType.Equals(boolean)) throw new NotBooleanTestExpression(visitable.Test.Segment, tType); - var cType = visitable.Consequent.Accept(this); - var aType = visitable.Alternate.Accept(this); + var cType = visitable.Consequent.Accept(This); + var aType = visitable.Alternate.Accept(This); if (cType.Equals(aType)) return cType; @@ -182,8 +189,8 @@ public Type Visit(ConditionalExpression visitable) public Type Visit(BinaryExpression visitable) { - var lType = visitable.Left.Accept(this); - var rType = visitable.Right.Accept(this); + var lType = visitable.Left.Accept(This); + var rType = visitable.Right.Accept(This); if (visitable.Operator != "::" && !lType.Equals(rType)) throw new IncompatibleTypesOfOperands( @@ -224,7 +231,7 @@ public Type Visit(BinaryExpression visitable) public Type Visit(UnaryExpression visitable) { - var eType = visitable.Expression.Accept(this); + var eType = visitable.Expression.Accept(This); Type number = "number"; Type boolean = "boolean"; @@ -246,7 +253,7 @@ public Type Visit(LexicalDeclaration visitable) { var registeredSymbol = visitable.SymbolTable.FindSymbol( assignment.Destination.Id); - var sourceType = assignment.Source.Accept(this); + var sourceType = assignment.Source.Accept(This); if (sourceType.Equals(undefined)) throw new CannotDefineType(assignment.Source.Segment); if (!registeredSymbol!.Type.Equals(undefined) && !registeredSymbol.Type.Equals(sourceType)) @@ -274,10 +281,10 @@ public Type Visit(AssignmentExpression visitable) if (visitable.Destination is CallExpression) throw new WrongAssignmentTarget(visitable.Destination); - var sourceType = visitable.Source.Accept(this); + var sourceType = visitable.Source.Accept(This); if (!visitable.Destination.Empty()) { - var destinationType = visitable.Destination.Accept(this); + var destinationType = visitable.Destination.Accept(This); if (!destinationType.Equals(sourceType)) throw new IncompatibleTypesOfOperands( visitable.Segment, @@ -305,9 +312,9 @@ public Type Visit(AssignmentExpression visitable) public Type Visit(MemberExpression visitable) { - var idType = visitable.Id.Accept(this); + var idType = visitable.Id.Accept(This); visitable.ComputedIdType = idType; - return visitable.Empty() ? idType : visitable.AccessChain?.Accept(this) ?? "undefined"; + return visitable.Empty() ? idType : visitable.AccessChain?.Accept(This) ?? "undefined"; } public Type Visit(IndexAccess visitable) @@ -320,13 +327,13 @@ public Type Visit(IndexAccess visitable) throw new NonAccessibleType(prevType); Type number = "number"; - var indexType = visitable.Index.Accept(this); + var indexType = visitable.Index.Accept(This); if (!indexType.Equals(number)) throw new ArrayAccessException(visitable.Segment, indexType); var elemType = arrayType.Type; visitable.ComputedType = elemType; - return visitable.HasNext() ? visitable.Next?.Accept(this) ?? "undefined" : elemType; + return visitable.HasNext() ? visitable.Next?.Accept(This) ?? "undefined" : elemType; } public Type Visit(DotAccess visitable) @@ -345,13 +352,13 @@ public Type Visit(DotAccess visitable) ? objectType : throw new ObjectAccessException(visitable.Segment, objectType, visitable.Property); visitable.ComputedType = fieldType; - return visitable.HasNext() ? visitable.Next?.Accept(this) ?? "undefined" : fieldType; + return visitable.HasNext() ? visitable.Next?.Accept(This) ?? "undefined" : fieldType; } public Type Visit(CastAsExpression visitable) { Type undefined = "undefined"; - var exprType = visitable.Expression.Accept(this); + var exprType = visitable.Expression.Accept(This); if (exprType.Equals(undefined)) throw new CannotDefineType(visitable.Expression.Segment); @@ -368,7 +375,7 @@ public Type Visit(CallExpression visitable) if (methodCall) { - var objectType = (ObjectType)visitable.Member.Accept(this); + var objectType = (ObjectType)visitable.Member.Accept(This); var availableMethods = _methodStorage.GetAvailableMethods(objectType); functionSymbol = availableMethods[objectType.LastAccessedMethod]; } @@ -394,7 +401,7 @@ symbol as FunctionSymbol .ToList().ForEach(pair => { var (expr, expected) = pair; - var actualType = expr.Accept(this); + var actualType = expr.Accept(This); if (!actualType.Equals(expected.Type)) throw new WrongTypeOfArgument(expr.Segment, expected.Type, actualType); }); @@ -403,7 +410,7 @@ symbol as FunctionSymbol if (functionSymbol.Type.Equals(undefined)) { var declaration = _functionStorage.Get(functionSymbol); - functionReturnType = declaration.Accept(this); + functionReturnType = declaration.Accept(This); } return functionReturnType; @@ -413,13 +420,13 @@ public Type Visit(FunctionDeclaration visitable) { var symbol = visitable.SymbolTable.FindSymbol(visitable.Name)!; _functionStorage.RemoveIfPresent(symbol); - visitable.Statements.Accept(this); + visitable.Statements.Accept(This); var returnStatements = visitable.GetReturnStatements() .Select(x => new { Statement = x, - Type = x.Accept(this) + Type = x.Accept(This) }); Type undefined = "undefined"; if (symbol.Type.Equals(undefined)) @@ -453,7 +460,7 @@ public Type Visit(FunctionDeclaration visitable) public Type Visit(BlockStatement visitable) { - visitable.StatementList.ForEach(x => x.Accept(this)); + visitable.StatementList.ForEach(x => x.Accept(This)); return "undefined"; } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs index 94bf278a..8b43a888 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs @@ -6,8 +6,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class SymbolTableInitializer : - IVisitor, +public class SymbolTableInitializer : VisitorNoReturnBase, IVisitor, IVisitor, IVisitor @@ -23,32 +22,32 @@ public SymbolTableInitializer( _provider = provider; } - public Unit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { _initializerService.InitThroughParent(visitable); foreach (var child in visitable) - child.Accept(this); + child.Accept(This); return default; } - public Unit Visit(ScriptBody visitable) + public VisitUnit Visit(ScriptBody visitable) { visitable.SymbolTable = _provider.GetStandardLibrary(); - visitable.StatementList.ForEach(item => item.Accept(this)); + visitable.StatementList.ForEach(item => item.Accept(This)); return default; } - public Unit Visit(FunctionDeclaration visitable) + public VisitUnit Visit(FunctionDeclaration visitable) { _initializerService.InitWithNewScope(visitable); - visitable.Statements.Accept(this); + visitable.Statements.Accept(This); return default; } - public Unit Visit(BlockStatement visitable) + public VisitUnit Visit(BlockStatement visitable) { _initializerService.InitWithNewScope(visitable); - visitable.StatementList.ForEach(item => item.Accept(this)); + visitable.StatementList.ForEach(item => item.Accept(This)); return default; } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs index 871eb898..c47d756e 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs @@ -7,9 +7,8 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class TypeSystemLoader : +public class TypeSystemLoader : VisitorNoReturnBase, IVisitor, - IVisitor, IVisitor { private readonly ITypeDeclarationsResolver _resolver; @@ -23,22 +22,22 @@ public TypeSystemLoader( _defaultTypes = provider.GetDefaultTypes().ToHashSet(); } - public Unit Visit(ScriptBody visitable) + public VisitUnit Visit(ScriptBody visitable) { - visitable.StatementList.ForEach(item => item.Accept(this)); + visitable.StatementList.ForEach(item => item.Accept(This)); _resolver.Resolve(); return default; } - public Unit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { foreach (var child in visitable) - child.Accept(this); + child.Accept(This); return default; } - public Unit Visit(TypeDeclaration visitable) + public VisitUnit Visit(TypeDeclaration visitable) { if (visitable.SymbolTable.ContainsSymbol(visitable.TypeId) || _defaultTypes.Contains(visitable.TypeId.Name)) From ca57c6964cb384132ef27a461dc3fba6134a656c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Fri, 26 Jul 2024 18:42:40 +0300 Subject: [PATCH 14/35] =?UTF-8?q?#59=20-=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=20=D0=BD=D0=B0=20IReadOnlyList=20(#70)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #31 - change nullability of Parent * #31 unbound ast node from segment * #59 - переход на IReadOnlyList --- .../FrontEnd/GetTokens/Data/Token.cs | 3 ++ .../FrontEnd/TopDownParse/Impl/Parser.cs | 5 ++- .../IR/Ast/AbstractSyntaxTreeNode.cs | 40 ++++++++++--------- .../FunctionDeclaration.cs | 21 ++++------ .../AfterTypesAreLoaded/LexicalDeclaration.cs | 12 +++--- .../Nodes/Declarations/TypeDeclaration.cs | 20 ++-------- .../AccessExpressions/DotAccess.cs | 12 ++---- .../AccessExpressions/IndexAccess.cs | 12 ++---- .../Nodes/Expressions/AssignmentExpression.cs | 9 ++--- .../Nodes/Expressions/BinaryExpression.cs | 9 ++--- .../Impl/Nodes/Expressions/CallExpression.cs | 27 +++++-------- .../Nodes/Expressions/CastAsExpression.cs | 8 ++-- .../ComplexLiterals/ArrayLiteral.cs | 14 ++++--- .../ComplexLiterals/ObjectLiteral.cs | 14 ++++--- .../Expressions/ComplexLiterals/Property.cs | 9 ++--- .../Expressions/ConditionalExpression.cs | 10 ++--- .../Nodes/Expressions/MemberExpression.cs | 28 +++++-------- .../PrimaryExpressions/PrimaryExpression.cs | 5 --- .../Impl/Nodes/Expressions/UnaryExpression.cs | 8 ++-- .../IR/Ast/Impl/Nodes/ScriptBody.cs | 15 ++++--- .../Impl/Nodes/Statements/BlockStatement.cs | 14 ++++--- .../Nodes/Statements/ExpressionStatement.cs | 10 ++--- .../Ast/Impl/Nodes/Statements/IfStatement.cs | 23 +++++------ .../Nodes/Statements/InsideStatementJump.cs | 5 --- .../Impl/Nodes/Statements/ReturnStatement.cs | 13 ++---- .../Impl/Nodes/Statements/WhileStatement.cs | 9 ++--- .../IR/Ast/Visitors/InstructionProvider.cs | 11 +++-- .../Exceptions/ArrayAccessException.cs | 9 ++--- .../Exceptions/AssignmentToConst.cs | 7 +--- .../Exceptions/CannotDefineType.cs | 7 +--- .../Exceptions/ConstWithoutInitializer.cs | 7 +--- .../Exceptions/DeclarationAlreadyExists.cs | 7 +--- .../FunctionWithoutReturnStatement.cs | 8 +--- .../Exceptions/IncompatibleTypesOfOperands.cs | 8 +--- .../Exceptions/NonAccessibleType.cs | 7 +--- .../Exceptions/NotBooleanTestExpression.cs | 8 +--- .../Exceptions/ObjectAccessException.cs | 8 +--- .../Exceptions/OutsideOfStatement.cs | 8 +--- .../Exceptions/ReturnOutsideFunction.cs | 8 +--- .../Exceptions/SemanticException.cs | 25 +++++++----- .../Exceptions/SymbolIsNotCallable.cs | 8 +--- .../Exceptions/UnknownIdentifierReference.cs | 7 +--- .../Exceptions/UnsupportedOperation.cs | 8 +--- .../WrongArrayLiteralDeclaration.cs | 10 ++--- .../Exceptions/WrongAssignmentTarget.cs | 9 ++--- .../Exceptions/WrongConditionalTypes.cs | 14 ++++--- .../Exceptions/WrongNumberOfArguments.cs | 10 ++--- .../Exceptions/WrongReturnType.cs | 10 ++--- .../Exceptions/WrongTypeOfArgument.cs | 10 ++--- .../Visitors/DeclarationVisitor.cs | 9 +++-- .../Visitors/SemanticChecker.cs | 17 ++++---- .../Impl/SymbolTableInitializerService.cs | 4 +- .../Visitors/SymbolTableInitializer.cs | 11 +++-- .../Visitors/TypeSystemLoader.cs | 7 ++-- .../HydraScript.Tests/Unit/IR/AstNodeTests.cs | 10 ++--- 55 files changed, 256 insertions(+), 371 deletions(-) diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs index 2e614cde..3d007a73 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs +++ b/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs @@ -31,6 +31,9 @@ public record Segment(Coordinates Start, Coordinates End) public static Segment operator +(Segment left, Segment right) => new(left.Start, right.End); + + public static implicit operator string(Segment segment) => + segment.ToString(); } [ExcludeFromCodeCoverage] diff --git a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs index aee920f8..14e9e840 100644 --- a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs +++ b/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs @@ -492,7 +492,10 @@ private Expression ConditionalExpression() var consequent = Expression(); Expect("Colon"); var alternate = Expression(); - return new ConditionalExpression(test, consequent, alternate); + return new ConditionalExpression(test, consequent, alternate) + { + Segment = consequent.Segment + alternate.Segment + }; } return test; diff --git a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs index b4ef320e..fa4eed5a 100644 --- a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs +++ b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs @@ -1,29 +1,38 @@ using System.Collections; -using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.IR.CheckSemantics.Variables; namespace HydraScript.Lib.IR.Ast; public abstract class AbstractSyntaxTreeNode : - IEnumerable, + IReadOnlyList, IVisitable { - public AbstractSyntaxTreeNode? Parent { get; set; } + public AbstractSyntaxTreeNode Parent { get; set; } = default!; + + protected virtual bool IsRoot => false; public SymbolTable SymbolTable { get; set; } = default!; - public Segment Segment { get; init; } = default!; + public string Segment { get; init; } = string.Empty; + + protected virtual IReadOnlyList Children { get; } = []; + + public IEnumerator GetEnumerator() => + Children.ToList().GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => + GetEnumerator(); + + public int Count => Children.Count; + + public AbstractSyntaxTreeNode this[int index] => + Children[index]; internal List GetAllNodes() { - var result = new List - { - this - }; - foreach (var child in this) - { - result.AddRange(child.GetAllNodes()); - } + List result = [this]; + for (var index = 0; index < Children.Count; index++) + result.AddRange(Children[index].GetAllNodes()); return result; } @@ -31,7 +40,7 @@ internal List GetAllNodes() public bool ChildOf() where T : AbstractSyntaxTreeNode { var parent = Parent; - while (parent != null) + while (!parent.IsRoot) { if (parent is T) { @@ -44,11 +53,6 @@ public bool ChildOf() where T : AbstractSyntaxTreeNode return false; } - public abstract IEnumerator GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => - GetEnumerator(); - public virtual TReturn Accept(IVisitor visitor) => visitor.DefaultVisit; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs index 947e7ced..0d2c02e3 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -6,7 +6,7 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; [AutoVisitable] public partial class FunctionDeclaration : AfterTypesAreLoadedDeclaration { - private IReadOnlyCollection? _returnStatements; + protected override IReadOnlyList Children => [Statements]; public IdentifierReference Name { get; } public TypeValue ReturnTypeValue { get; } @@ -25,25 +25,18 @@ public FunctionDeclaration( Statements = blockStatement; Statements.Parent = this; - } - - public bool HasReturnStatement() - { - _returnStatements ??= GetReturnStatements(); - return _returnStatements.Count > 0; - } - public IReadOnlyCollection GetReturnStatements() => - _returnStatements ??= Statements + ReturnStatements = Statements .GetAllNodes() .OfType() .ToArray(); - - public override IEnumerator GetEnumerator() - { - yield return Statements; } + public bool HasReturnStatement() => + ReturnStatements.Count > 0; + + public IReadOnlyCollection ReturnStatements { get; } + protected override string NodeRepresentation() => "function " + Name; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs index 4374f6d9..aa38d093 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs @@ -5,18 +5,20 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; [AutoVisitable] public partial class LexicalDeclaration(bool readOnly) : AfterTypesAreLoadedDeclaration { + private readonly List _assignments = []; + protected override IReadOnlyList Children => + _assignments; + public bool ReadOnly { get; } = readOnly; - public List Assignments { get; } = []; + public IReadOnlyList Assignments => + _assignments; public void AddAssignment(AssignmentExpression assignment) { assignment.Parent = this; - Assignments.Add(assignment); + _assignments.Add(assignment); } - public override IEnumerator GetEnumerator() => - Assignments.GetEnumerator(); - protected override string NodeRepresentation() => ReadOnly ? "const" : "let"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs index aef76c8e..cca75678 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs @@ -3,25 +3,13 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; [AutoVisitable] -public partial class TypeDeclaration : Declaration +public partial class TypeDeclaration(IdentifierReference typeId, TypeValue typeValue) : Declaration { - private readonly TypeValue _typeValue; - public IdentifierReference TypeId { get; } - - public TypeDeclaration(IdentifierReference typeId, TypeValue typeValue) - { - TypeId = typeId; - _typeValue = typeValue; - } + public IdentifierReference TypeId { get; } = typeId; public Type BuildType() => - _typeValue.BuildType(SymbolTable); - - public override IEnumerator GetEnumerator() - { - yield break; - } + typeValue.BuildType(SymbolTable); protected override string NodeRepresentation() => - $"type {TypeId.Name} = {_typeValue}"; + $"type {TypeId.Name} = {typeValue}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs index bb9094ac..94054711 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -5,6 +5,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; [AutoVisitable] public partial class DotAccess : AccessExpression { + protected override IReadOnlyList Children => + HasNext() ? [Property, Next!] : [Property]; + public IdentifierReference Property { get; } public DotAccess(IdentifierReference property, AccessExpression? prev = null) : base(prev) @@ -13,14 +16,5 @@ public DotAccess(IdentifierReference property, AccessExpression? prev = null) : Property.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Property; - if (HasNext()) - { - yield return Next!; - } - } - protected override string NodeRepresentation() => "."; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs index 4216f2b6..1a74d2a0 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; [AutoVisitable] public partial class IndexAccess : AccessExpression { + protected override IReadOnlyList Children => + HasNext() ? [Index, Next!] : [Index]; + public Expression Index { get; } public IndexAccess(Expression index, AccessExpression? prev = null) : base(prev) @@ -11,14 +14,5 @@ public IndexAccess(Expression index, AccessExpression? prev = null) : base(prev) Index.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Index; - if (HasNext()) - { - yield return Next!; - } - } - protected override string NodeRepresentation() => "[]"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs index d41f5f2d..4e5e0966 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs @@ -5,6 +5,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class AssignmentExpression : Expression { + protected override IReadOnlyList Children => + [Destination, Source]; + public LeftHandSideExpression Destination { get; } public Expression Source { get; } public TypeValue? DestinationType { get; } @@ -23,11 +26,5 @@ public AssignmentExpression( DestinationType = destinationType; } - public override IEnumerator GetEnumerator() - { - yield return Destination; - yield return Source; - } - protected override string NodeRepresentation() => "="; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs index bbebf623..0acb152a 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class BinaryExpression : Expression { + protected override IReadOnlyList Children => + [Left, Right]; + public Expression Left { get; } public string Operator { get; } public Expression Right { get; } @@ -18,11 +21,5 @@ public BinaryExpression(Expression left, string @operator, Expression right) Right.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Left; - yield return Right; - } - protected override string NodeRepresentation() => Operator; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs index dca0bb29..eeb07276 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs @@ -5,33 +5,26 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class CallExpression : LeftHandSideExpression { + private readonly List _parameters; + + protected override IReadOnlyList Children => + [Member, .._parameters]; + public MemberExpression Member { get; } - public List Parameters { get; } + public IReadOnlyList Parameters => _parameters; public CallExpression(MemberExpression member, IEnumerable expressions) { Member = member; Member.Parent = this; - Parameters = new List(expressions); - Parameters.ForEach(expr => expr.Parent = this); + _parameters = new List(expressions); + _parameters.ForEach(expr => expr.Parent = this); } - public override IdentifierReference Id => - Member.Id; - - public override bool Empty() => - Member.Empty(); + public override IdentifierReference Id => Member.Id; - public override IEnumerator GetEnumerator() - { - var nodes = new List - { - Member - }; - nodes.AddRange(Parameters); - return nodes.GetEnumerator(); - } + public override bool Empty() => Member.Empty(); protected override string NodeRepresentation() => "()"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs index 4cf1e118..72ed955b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs @@ -5,6 +5,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class CastAsExpression : Expression { + protected override IReadOnlyList Children => + [Expression]; + public Expression Expression { get; } public TypeValue Cast { get; } @@ -16,10 +19,5 @@ public CastAsExpression(Expression expression, TypeValue cast) Cast = cast; } - public override IEnumerator GetEnumerator() - { - yield return Expression; - } - protected override string NodeRepresentation() => $"as {Cast}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs index 2b301e6c..6c96ca32 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs @@ -3,16 +3,18 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class ArrayLiteral : ComplexLiteral { - public List Expressions { get; } + private readonly List _expressions; + + protected override IReadOnlyList Children => + _expressions; + + public IReadOnlyList Expressions => _expressions; public ArrayLiteral(IEnumerable expressions) { - Expressions = new List(expressions); - Expressions.ForEach(expr => expr.Parent = this); + _expressions = new List(expressions); + _expressions.ForEach(expr => expr.Parent = this); } - public override IEnumerator GetEnumerator() => - Expressions.GetEnumerator(); - protected override string NodeRepresentation() => "[]"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs index 02a88dc0..4724abaf 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs @@ -3,16 +3,18 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class ObjectLiteral : ComplexLiteral { - public List Properties { get; } + private readonly List _properties; + + protected override IReadOnlyList Children => + _properties; + + public IReadOnlyList Properties => _properties; public ObjectLiteral(IEnumerable properties) { - Properties = new List(properties); - Properties.ForEach(prop => prop.Parent = this); + _properties = new List(properties); + _properties.ForEach(prop => prop.Parent = this); } - public override IEnumerator GetEnumerator() => - Properties.GetEnumerator(); - protected override string NodeRepresentation() => "{}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs index adbf2691..21db416f 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs @@ -5,6 +5,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class Property : Expression { + protected override IReadOnlyList Children => + [Id, Expression]; + public IdentifierReference Id { get; } public Expression Expression { get; } @@ -25,12 +28,6 @@ public void Deconstruct(out string id, out Expression expr) id = Id.Name; expr = Expression; } - - public override IEnumerator GetEnumerator() - { - yield return Id; - yield return Expression; - } protected override string NodeRepresentation() => ":"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs index 0a0fafc6..1d32ab8b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class ConditionalExpression : Expression { + protected override IReadOnlyList Children => + [Test, Consequent, Alternate]; + public Expression Test { get; } public Expression Consequent { get; } public Expression Alternate { get; } @@ -18,12 +21,5 @@ public ConditionalExpression(Expression test, Expression consequent, Expression Alternate.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Test; - yield return Consequent; - yield return Alternate; - } - protected override string NodeRepresentation() => "?:"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs index 55206062..8aa041ef 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs @@ -8,24 +8,25 @@ public partial class MemberExpression : LeftHandSideExpression { private readonly IdentifierReference _identifierReference; + protected override IReadOnlyList Children => + AccessChain is not null ? [Id, AccessChain] : [Id]; + public AccessExpression? AccessChain { get; } public AccessExpression? Tail { get; } public Type ComputedIdType { get; set; } = default!; - public MemberExpression(IdentifierReference identifierReference) : - this(identifierReference, accessChain: null, tail: null) + public MemberExpression(IdentifierReference identifierReference) { + _identifierReference = identifierReference; + _identifierReference.Parent = this; } public MemberExpression( IdentifierReference identifierReference, AccessExpression? accessChain, - AccessExpression? tail) + AccessExpression? tail) : this(identifierReference) { - _identifierReference = identifierReference; - _identifierReference.Parent = this; - AccessChain = accessChain; if (AccessChain is not null) { @@ -35,20 +36,9 @@ public MemberExpression( Tail = tail; } - public override IdentifierReference Id => - _identifierReference; + public override IdentifierReference Id => _identifierReference; - public override bool Empty() => - AccessChain is null; - - public override IEnumerator GetEnumerator() - { - yield return Id; - if (AccessChain is not null) - { - yield return AccessChain; - } - } + public override bool Empty() => AccessChain is null; protected override string NodeRepresentation() => nameof(MemberExpression); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs index 59b23fb6..58805daa 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs @@ -5,10 +5,5 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; [AutoVisitable] public abstract partial class PrimaryExpression : Expression { - public override IEnumerator GetEnumerator() - { - yield break; - } - public abstract IValue ToValue(); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs index 553cebc6..4de499d6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; [AutoVisitable] public partial class UnaryExpression : Expression { + protected override IReadOnlyList Children => + [Expression]; + public string Operator { get; } public Expression Expression { get; } @@ -14,10 +17,5 @@ public UnaryExpression(string @operator, Expression expression) Expression.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Expression; - } - protected override string NodeRepresentation() => Operator; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs index d1772bcd..39f7e4a5 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs @@ -3,16 +3,19 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes; [AutoVisitable] public partial class ScriptBody : AbstractSyntaxTreeNode { - public List StatementList { get; } + private readonly List _statementList; + + protected override IReadOnlyList Children => + _statementList; + protected override bool IsRoot => true; + + public IReadOnlyList StatementList => _statementList; public ScriptBody(IEnumerable statementList) { - StatementList = new List(statementList); - StatementList.ForEach(item => item.Parent = this); + _statementList = new List(statementList); + _statementList.ForEach(item => item.Parent = this); } - public override IEnumerator GetEnumerator() => - StatementList.GetEnumerator(); - protected override string NodeRepresentation() => "Script"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs index fee3b6a5..852e69e5 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs @@ -3,16 +3,18 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; [AutoVisitable] public partial class BlockStatement : Statement { - public List StatementList { get; } + private readonly List _statementList; + + protected override IReadOnlyList Children => + _statementList; + + public IReadOnlyList StatementList => _statementList; public BlockStatement(IEnumerable statementList) { - StatementList = new List(statementList); - StatementList.ForEach(item => item.Parent = this); + _statementList = new List(statementList); + _statementList.ForEach(item => item.Parent = this); } - public override IEnumerator GetEnumerator() => - StatementList.GetEnumerator(); - protected override string NodeRepresentation() => "{}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs index 6fbfb516..e0f80006 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs @@ -3,17 +3,15 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; [AutoVisitable] public partial class ExpressionStatement : Statement { + protected override IReadOnlyList Children => + [Expression]; + public Expression Expression { get; } public ExpressionStatement(Expression expression) { Expression = expression; - expression.Parent = this; - } - - public override IEnumerator GetEnumerator() - { - yield return Expression; + Expression.Parent = this; } protected override string NodeRepresentation() => nameof(ExpressionStatement); diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs index 3be48613..e590ff72 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; [AutoVisitable] public partial class IfStatement : Statement { + protected override IReadOnlyList Children => + Else is not null ? [Test, Then, Else] : [Test, Then]; + public Expression Test { get; } public Statement Then { get; } public Statement? Else { get; } @@ -22,21 +25,13 @@ public IfStatement(Expression test, Statement then, Statement? @else = null) } } - public bool Empty() => - !Then.Any() && !HasElseBlock(); - - public bool HasElseBlock() => - Else is not null && Else.Any(); - - public override IEnumerator GetEnumerator() + public bool Empty() => this is { - yield return Test; - yield return Then; - if (Else is not null) - { - yield return Else; - } - } + Then.Count: 0, + Else: null or { Count: 0 } + }; + + public bool HasElseBlock() => Else is { Count: > 0 }; protected override string NodeRepresentation() => "if"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs index 26f47e1b..3fe93305 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs @@ -8,10 +8,5 @@ public partial class InsideStatementJump(string keyword) : Statement public string Keyword { get; } = keyword; - public override IEnumerator GetEnumerator() - { - yield break; - } - protected override string NodeRepresentation() => Keyword; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs index 44d4cb14..5ecb17a9 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; [AutoVisitable] public partial class ReturnStatement : Statement { + protected override IReadOnlyList Children => + Expression is not null ? [Expression] : []; + public Expression? Expression { get; } public ReturnStatement(Expression? expression = null) @@ -14,15 +17,5 @@ public ReturnStatement(Expression? expression = null) } } - public override IEnumerator GetEnumerator() - { - if (Expression is null) - { - yield break; - } - - yield return Expression; - } - protected override string NodeRepresentation() => "return"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs index d9930095..3f113ff4 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs @@ -3,6 +3,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; [AutoVisitable] public partial class WhileStatement : Statement { + protected override IReadOnlyList Children => + [Condition, Statement]; + public Expression Condition { get; } public Statement Statement { get; } @@ -15,11 +18,5 @@ public WhileStatement(Expression condition, Statement statement) Statement.Parent = this; } - public override IEnumerator GetEnumerator() - { - yield return Condition; - yield return Statement; - } - protected override string NodeRepresentation() => "while"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs index d7f9f0e5..9f1f0334 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs +++ b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs @@ -32,9 +32,10 @@ public InstructionProvider() public AddressedInstructions Visit(ScriptBody visitable) { var result = new AddressedInstructions(); - foreach (var item in visitable.StatementList) + for (var i = 0; i < visitable.Count; i++) { - result.AddRange(item.Accept(This)); + var instructions = visitable[i].Accept(This); + result.AddRange(instructions); } result.Add(new Halt()); @@ -47,8 +48,9 @@ public AddressedInstructions Visit(ScriptBody visitable) public AddressedInstructions Visit(LexicalDeclaration visitable) { var result = new AddressedInstructions(); - foreach (var assignment in visitable.Assignments) + for (var i = 0; i < visitable.Count; i++) { + var assignment = visitable[i]; result.AddRange(assignment.Accept(_expressionVisitor)); } @@ -58,8 +60,9 @@ public AddressedInstructions Visit(LexicalDeclaration visitable) public AddressedInstructions Visit(BlockStatement visitable) { var result = new AddressedInstructions(); - foreach (var item in visitable.StatementList) + for (var i = 0; i < visitable.Count; i++) { + var item = visitable[i]; result.AddRange(item.Accept(This)); if (item is ReturnStatement) break; } diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs index 59c91062..7884cdc4 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs @@ -1,11 +1,8 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class ArrayAccessException : SemanticException -{ - public ArrayAccessException(Segment segment, Type type) : - base(segment, $"Array element cannot be accessed with type {type} it must be of type number") { } -} \ No newline at end of file +public class ArrayAccessException(string segment, Type type) : SemanticException( + segment, + $"Array element cannot be accessed with type {type} it must be of type number"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs index 48d187e9..afe0b251 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs @@ -4,8 +4,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class AssignmentToConst : SemanticException -{ - public AssignmentToConst(IdentifierReference ident) : - base(ident.Segment,$"Cannot assign to const: {ident.Name}") { } -} \ No newline at end of file +public class AssignmentToConst(IdentifierReference ident) + : SemanticException(ident.Segment, $"Cannot assign to const: {ident.Name}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs index df99c271..357b09e3 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs @@ -1,11 +1,6 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class CannotDefineType : SemanticException -{ - public CannotDefineType(Segment segment) : - base(segment, "Cannot define type") { } -} \ No newline at end of file +public class CannotDefineType(string segment) : SemanticException(segment, "Cannot define type"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs index 2b0aa885..76ace72f 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs @@ -4,8 +4,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class ConstWithoutInitializer : SemanticException -{ - public ConstWithoutInitializer(IdentifierReference ident) : - base(ident.Segment, $"'const' without initializer: {ident.Name}") { } -} \ No newline at end of file +public class ConstWithoutInitializer(IdentifierReference ident) : + SemanticException(ident.Segment, $"'const' without initializer: {ident.Name}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs index ceafadc9..6ac5ed25 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs @@ -4,8 +4,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class DeclarationAlreadyExists : SemanticException -{ - public DeclarationAlreadyExists(IdentifierReference ident) : - base(ident.Segment, $"Declaration already exists: {ident.Name}") { } -} \ No newline at end of file +public class DeclarationAlreadyExists(IdentifierReference ident) : + SemanticException(ident.Segment, $"Declaration already exists: {ident.Name}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs index 26bdddf1..fcf9fb6c 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class FunctionWithoutReturnStatement : SemanticException -{ - public FunctionWithoutReturnStatement(Segment segment) : - base(segment, "function with non-void return type must have a return statement") { } -} \ No newline at end of file +public class FunctionWithoutReturnStatement(string segment) : + SemanticException(segment, "function with non-void return type must have a return statement"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs index 8781ac8b..eb7bfd52 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class IncompatibleTypesOfOperands : SemanticException -{ - public IncompatibleTypesOfOperands(Segment segment, Type left, Type right) : - base(segment, $"Incompatible types of operands: {left} and {right}") { } -} \ No newline at end of file +public class IncompatibleTypesOfOperands(string segment, Type left, Type right) : + SemanticException(segment, $"Incompatible types of operands: {left} and {right}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs index 9b76fa14..a2edae72 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs @@ -3,8 +3,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class NonAccessibleType : SemanticException -{ - public NonAccessibleType(Type type) : - base($"Type '{type}' is not array-like or object-like") { } -} \ No newline at end of file +public class NonAccessibleType(Type type) : + SemanticException($"Type '{type}' is not array-like or object-like"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs index 66bb9b3c..f1d5040c 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class NotBooleanTestExpression : SemanticException -{ - public NotBooleanTestExpression(Segment segment, Type type) : - base(segment, $"Type of expression is {type} but expected boolean") { } -} \ No newline at end of file +public class NotBooleanTestExpression(string segment, Type type) : + SemanticException(segment, $"Type of expression is {type} but expected boolean"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs index 2fbc9028..59e8183d 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs @@ -1,12 +1,8 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.IR.CheckSemantics.Types; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class ObjectAccessException : SemanticException -{ - public ObjectAccessException(Segment segment, ObjectType objectType, string field) : - base(segment, $"Object type {objectType} has no field {field}") { } -} \ No newline at end of file +public class ObjectAccessException(string segment, ObjectType objectType, string field) : + SemanticException(segment, $"Object type {objectType} has no field {field}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs index 799f8807..61ec09f8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class OutsideOfStatement : SemanticException -{ - public OutsideOfStatement(Segment segment, string keyword, string statement) : - base(segment, $"Jump \"{keyword}\" outside of statement \"{statement}\"") { } -} \ No newline at end of file +public class OutsideOfStatement(string segment, string keyword, string statement) : + SemanticException(segment, $"Jump \"{keyword}\" outside of statement \"{statement}\""); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs index 4fcb25b5..d2898af8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class ReturnOutsideFunction : SemanticException -{ - public ReturnOutsideFunction(Segment segment) : - base(segment, "\"return\" outside function") { } -} \ No newline at end of file +public class ReturnOutsideFunction(string segment) : + SemanticException(segment, "\"return\" outside function"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs index e5c2d5e9..c2dcb1b6 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs @@ -1,17 +1,24 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [Serializable, ExcludeFromCodeCoverage] public abstract class SemanticException : Exception { - protected SemanticException() { } - - protected SemanticException(string message) : base(message) { } - - protected SemanticException(string message, Exception inner) : base(message, inner) { } - - protected SemanticException(Segment segment, string message) : - base($"{segment} {message}") { } + protected SemanticException() + { + } + + protected SemanticException(string message) : base(message) + { + } + + protected SemanticException(string message, Exception inner) : base(message, inner) + { + } + + protected SemanticException(string segment, string message) : + base($"{segment} {message}") + { + } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs index 9dd2e9cc..f8eaede5 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class SymbolIsNotCallable : SemanticException -{ - public SymbolIsNotCallable(string symbol, Segment segment) : - base(segment, $"Symbol is not callable: {symbol}") { } -} \ No newline at end of file +public class SymbolIsNotCallable(string symbol, string segment) : + SemanticException(segment, $"Symbol is not callable: {symbol}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs index 523a01ce..8476d9ad 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs @@ -4,8 +4,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class UnknownIdentifierReference : SemanticException -{ - public UnknownIdentifierReference(IdentifierReference ident) : - base(ident.Segment, $"Unknown identifier reference: {ident.Name}") { } -} \ No newline at end of file +public class UnknownIdentifierReference(IdentifierReference ident) : + SemanticException(ident.Segment, $"Unknown identifier reference: {ident.Name}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs index e2fe77bc..996a1707 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs @@ -1,11 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class UnsupportedOperation : SemanticException -{ - public UnsupportedOperation(Segment segment, Type type, string @operator) : - base(segment, $"Type {type} does not support operation {@operator}") { } -} \ No newline at end of file +public class UnsupportedOperation(string segment, Type type, string @operator) : + SemanticException(segment, $"Type {type} does not support operation {@operator}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs index f14a072b..846d8230 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs @@ -1,11 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongArrayLiteralDeclaration : SemanticException -{ - public WrongArrayLiteralDeclaration(Segment segment, Type type) : - base(segment, $"{segment} Wrong array literal declaration: all array elements must be of type {type}") { } -} \ No newline at end of file +public class WrongArrayLiteralDeclaration(string segment, Type type) : + SemanticException( + segment, + $"Wrong array literal declaration: all array elements must be of type {type}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs index 5f04a672..5cb6b460 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs @@ -4,8 +4,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongAssignmentTarget : SemanticException -{ - public WrongAssignmentTarget(LeftHandSideExpression lhs) : - base(lhs.Segment, $"Assignment target must be variable, property or indexer. '{lhs.Id.Name}' is {lhs.GetType().Name}") { } -} \ No newline at end of file +public class WrongAssignmentTarget(LeftHandSideExpression lhs) : + SemanticException( + lhs.Segment, + $"Assignment target must be variable, property or indexer. '{lhs.Id.Name}' is {lhs.GetType().Name}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs index 78e87b63..458d4323 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs @@ -1,11 +1,13 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongConditionalTypes : SemanticException -{ - public WrongConditionalTypes(Segment cSegment, Type cType, Segment aSegment, Type aType) : - base(cSegment + aSegment, $"Different types in conditional: {cSegment} consequent - {cType}, {aSegment} alternate {aType}") { } -} \ No newline at end of file +public class WrongConditionalTypes( + string segment, + string cSegment, + Type cType, + string aSegment, + Type aType) : SemanticException( + segment, + $"Different types in conditional: {cSegment} consequent - {cType}, {aSegment} alternate {aType}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs index 0260cdc3..0da12f04 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs @@ -1,11 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongNumberOfArguments : SemanticException -{ - public WrongNumberOfArguments(Segment segment, int expected, int actual) : - base(segment, $"Wrong number of arguments: expected {expected}, actual {actual}") { } -} \ No newline at end of file +public class WrongNumberOfArguments(string segment, int expected, int actual) : + SemanticException( + segment, + $"Wrong number of arguments: expected {expected}, actual {actual}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs index 6a9feefc..68ae9d53 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs @@ -1,11 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongReturnType : SemanticException -{ - public WrongReturnType(Segment segment, Type expected, Type actual) : - base(segment, $"Wrong return type: expected {expected}, actual {actual}") { } -} \ No newline at end of file +public class WrongReturnType(string segment, Type expected, Type actual) : + SemanticException( + segment, + $"Wrong return type: expected {expected}, actual {actual}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs index 77ae4927..8dc8c19b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs @@ -1,11 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; [ExcludeFromCodeCoverage] -public class WrongTypeOfArgument : SemanticException -{ - public WrongTypeOfArgument(Segment segment, Type expected, Type actual) : - base(segment,$"Wrong type of argument: expected {expected}, actual {actual}") { } -} \ No newline at end of file +public class WrongTypeOfArgument(string segment, Type expected, Type actual) : + SemanticException( + segment, + $"Wrong type of argument: expected {expected}, actual {actual}"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs index 41ce2efc..5bf69f53 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs @@ -27,16 +27,17 @@ public DeclarationVisitor( public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { - foreach (var child in visitable) - child.Accept(This); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); return default; } public VisitUnit Visit(LexicalDeclaration visitable) { - foreach (var assignment in visitable.Assignments) + for (var i = 0; i < visitable.Assignments.Count; i++) { + var assignment = visitable.Assignments[i]; if (visitable.SymbolTable.ContainsSymbol(assignment.Destination.Id)) throw new DeclarationAlreadyExists(assignment.Destination.Id); @@ -60,7 +61,7 @@ public VisitUnit Visit(LexicalDeclaration visitable) public VisitUnit Visit(FunctionDeclaration visitable) { - if (visitable.Parent!.SymbolTable.ContainsSymbol(visitable.Name)) + if (visitable.Parent.SymbolTable.ContainsSymbol(visitable.Name)) throw new DeclarationAlreadyExists(visitable.Name); var parameters = visitable.Arguments.Select(x => diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs index 0d954eda..ed6acc60 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs @@ -56,8 +56,8 @@ public SemanticChecker( public Type Visit(ScriptBody visitable) { - foreach (var statementListItem in visitable.StatementList) - statementListItem.Accept(This); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); foreach (var funcDecl in _functionStorage.Flush()) funcDecl.Accept(This); @@ -131,11 +131,11 @@ public Type Visit(IdentifierReference visitable) } public Type Visit(Literal visitable) => - visitable.Type.BuildType(visitable.Parent!.SymbolTable); + visitable.Type.BuildType(visitable.Parent.SymbolTable); public Type Visit(ImplicitLiteral visitable) { - var type = visitable.TypeValue.BuildType(visitable.Parent!.SymbolTable); + var type = visitable.TypeValue.BuildType(visitable.Parent.SymbolTable); visitable.ComputedDefaultValue = _calculator.GetDefaultValueForType(type); return type; } @@ -181,6 +181,7 @@ public Type Visit(ConditionalExpression visitable) return cType; throw new WrongConditionalTypes( + segment: visitable.Segment, cSegment: visitable.Consequent.Segment, cType, aSegment: visitable.Alternate.Segment, @@ -249,8 +250,9 @@ public Type Visit(LexicalDeclaration visitable) { Type undefined = "undefined"; - foreach (var assignment in visitable.Assignments) + for (var i = 0; i < visitable.Assignments.Count; i++) { + var assignment = visitable.Assignments[i]; var registeredSymbol = visitable.SymbolTable.FindSymbol( assignment.Destination.Id); var sourceType = assignment.Source.Accept(This); @@ -422,7 +424,7 @@ public Type Visit(FunctionDeclaration visitable) _functionStorage.RemoveIfPresent(symbol); visitable.Statements.Accept(This); - var returnStatements = visitable.GetReturnStatements() + var returnStatements = visitable.ReturnStatements .Select(x => new { Statement = x, @@ -460,7 +462,8 @@ public Type Visit(FunctionDeclaration visitable) public Type Visit(BlockStatement visitable) { - visitable.StatementList.ForEach(x => x.Accept(This)); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); return "undefined"; } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs index 86dc7c1d..8564f59a 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs @@ -5,11 +5,11 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; internal class SymbolTableInitializerService : ISymbolTableInitializerService { public void InitThroughParent(AbstractSyntaxTreeNode node) => - node.SymbolTable = node.Parent!.SymbolTable; + node.SymbolTable = node.Parent.SymbolTable; public void InitWithNewScope(AbstractSyntaxTreeNode node) { node.SymbolTable = new(); - node.SymbolTable.AddOpenScope(node.Parent!.SymbolTable); + node.SymbolTable.AddOpenScope(node.Parent.SymbolTable); } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs index 8b43a888..f89deae1 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs @@ -25,15 +25,17 @@ public SymbolTableInitializer( public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { _initializerService.InitThroughParent(visitable); - foreach (var child in visitable) - child.Accept(This); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); + return default; } public VisitUnit Visit(ScriptBody visitable) { visitable.SymbolTable = _provider.GetStandardLibrary(); - visitable.StatementList.ForEach(item => item.Accept(This)); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); return default; } @@ -47,7 +49,8 @@ public VisitUnit Visit(FunctionDeclaration visitable) public VisitUnit Visit(BlockStatement visitable) { _initializerService.InitWithNewScope(visitable); - visitable.StatementList.ForEach(item => item.Accept(This)); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); return default; } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs index c47d756e..a93618e1 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs @@ -24,15 +24,16 @@ public TypeSystemLoader( public VisitUnit Visit(ScriptBody visitable) { - visitable.StatementList.ForEach(item => item.Accept(This)); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); _resolver.Resolve(); return default; } public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) { - foreach (var child in visitable) - child.Accept(This); + for (var i = 0; i < visitable.Count; i++) + visitable[i].Accept(This); return default; } diff --git a/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs b/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs index 55367f6d..7f3341e1 100644 --- a/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs @@ -13,19 +13,19 @@ public class AstNodeTests public void PrecedenceTest() { var lexicalDecl = new LexicalDeclaration(false); - var stmtItemList = new List - { - lexicalDecl - }; + List stmtItemList = [lexicalDecl]; // ReSharper disable once UnusedVariable var func = new FunctionDeclaration( name: new IdentifierReference(name: Guid.NewGuid().ToString()), new TypeIdentValue( TypeId: new IdentifierReference( name: Guid.NewGuid().ToString())), - arguments: new List(), + arguments: [], new BlockStatement(stmtItemList)); + _ = new ScriptBody([func]); + Assert.True(lexicalDecl.ChildOf()); + Assert.False(lexicalDecl.ChildOf()); } } \ No newline at end of file From 396bf92e50a503034c4a40ad46ee31403842e452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sat, 27 Jul 2024 19:11:37 +0300 Subject: [PATCH 15/35] =?UTF-8?q?Draft:=20=D0=92=D1=8B=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=B4=D0=BE=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #31 - IAbstractSyntaxTreeNode.cs * #31 - tree internal * #31 - separate ast from backend * #31 - segment * #31 - separate ast from backend 2 * #31 - value dto converter * #31 - удалил Type из TypeValue * #31 - fix test * #31 - symbol contracts * #31 - tuple -> dto * #31 - End is property * mv * #31 - backend mv * #31 - backend subdomain * #31 - scope dto for ast * #31 - rename * #31 - rename * #31 - ISymbolTable -> Scope * #31 - SymbolTableStorage.cs * #31 - fix bug * #31 - remove IR from codegen --- .../BackEnd/AddressedInstructions.cs | 21 +++-- src/HydraScript.Lib/BackEnd/Call.cs | 20 +++++ src/HydraScript.Lib/BackEnd/Frame.cs | 16 ++++ .../BackEnd/{Addresses => }/IAddress.cs | 2 +- .../BackEnd/IExecutableInstruction.cs | 8 ++ src/HydraScript.Lib/BackEnd/IExecuteParams.cs | 9 ++ .../BackEnd/{Values => }/IValue.cs | 2 +- .../BackEnd/IVirtualMachine.cs | 7 ++ .../{ => Impl}/Addresses/HashAddress.cs | 2 +- .../BackEnd/{ => Impl}/Addresses/Label.cs | 2 +- .../BackEnd/Impl/ExecuteParams.cs | 9 ++ .../{ => Impl}/Instructions/BlockLabel.cs | 6 +- .../BackEnd/Impl/Instructions/Halt.cs | 16 ++++ .../{ => Impl}/Instructions/Instruction.cs | 10 +-- .../BackEnd/Impl/Instructions/PopParameter.cs | 14 ++++ .../BackEnd/Impl/Instructions/Print.cs | 13 +++ .../Impl/Instructions/PushParameter.cs | 14 ++++ .../Instructions/RemoveFromArray.cs | 9 +- .../BackEnd/Impl/Instructions/Return.cs | 19 +++++ .../Instructions/WithAssignment/AsString.cs | 8 +- .../WithAssignment/CallFunction.cs | 24 ++++++ .../ComplexData/Create/CreateArray.cs | 8 +- .../ComplexData/Create/CreateObject.cs | 8 +- .../ComplexData/Read/DotRead.cs | 8 +- .../ComplexData/Read/IReadFromComplexData.cs | 8 ++ .../ComplexData/Read/IndexRead.cs | 8 +- .../ComplexData/Write/DotAssignment.cs | 11 ++- .../ComplexData/Write/IWriteToComplexData.cs | 6 ++ .../ComplexData/Write/IndexAssignment.cs | 11 ++- .../Instructions/WithAssignment/Simple.cs | 9 +- .../{ => Impl}/Instructions/WithJump/Goto.cs | 6 +- .../Instructions/WithJump/IfNotGoto.cs | 9 +- .../BackEnd/{ => Impl}/Values/Constant.cs | 2 +- .../BackEnd/{ => Impl}/Values/Name.cs | 2 +- .../BackEnd/Impl/VirtualMachine.cs | 21 +++++ .../BackEnd/Instructions/Halt.cs | 16 ---- .../BackEnd/Instructions/Print.cs | 21 ----- .../BackEnd/Instructions/PushParameter.cs | 16 ---- .../BackEnd/Instructions/Return.cs | 22 ----- .../WithAssignment/CallFunction.cs | 49 ----------- .../ComplexData/Read/IReadFromComplexData.cs | 10 --- .../ComplexData/Write/IWriteToComplexData.cs | 6 -- src/HydraScript.Lib/BackEnd/VirtualMachine.cs | 63 -------------- src/HydraScript.Lib/HydraScript.Lib.csproj | 2 +- .../IR/Ast/AbstractSyntaxTreeNode.cs | 63 -------------- .../IR/Ast/IAbstractSyntaxTree.cs | 4 +- .../IR/Ast/IAbstractSyntaxTreeNode.cs | 11 +++ .../IR/Ast/Impl/AbstractSyntaxTree.cs | 60 +++---------- .../IR/Ast/Impl/AbstractSyntaxTreeNode.cs | 66 +++++++++++++++ .../AfterTypesAreLoadedDeclaration.cs | 2 +- .../FunctionDeclaration.cs | 24 +++++- .../AfterTypesAreLoaded/LexicalDeclaration.cs | 4 +- .../Nodes/Declarations/TypeDeclaration.cs | 13 ++- .../Ast/Impl/Nodes/Declarations/TypeValue.cs | 37 +++----- .../AccessExpressions/AccessExpression.cs | 2 +- .../AccessExpressions/DotAccess.cs | 4 +- .../AccessExpressions/IndexAccess.cs | 4 +- .../Nodes/Expressions/AssignmentExpression.cs | 12 ++- .../Nodes/Expressions/BinaryExpression.cs | 4 +- .../Impl/Nodes/Expressions/CallExpression.cs | 7 +- .../Nodes/Expressions/CastAsExpression.cs | 11 ++- .../ComplexLiterals/ArrayLiteral.cs | 4 +- .../ComplexLiterals/ObjectLiteral.cs | 4 +- .../Expressions/ComplexLiterals/Property.cs | 4 +- .../Expressions/ConditionalExpression.cs | 4 +- .../Ast/Impl/Nodes/Expressions/Expression.cs | 2 +- .../Nodes/Expressions/MemberExpression.cs | 4 +- .../PrimaryExpressions/AbstractLiteral.cs | 15 ++++ .../PrimaryExpressions/IdentifierReference.cs | 7 +- .../PrimaryExpressions/ImplicitLiteral.cs | 12 ++- .../Expressions/PrimaryExpressions/Literal.cs | 16 ++-- .../PrimaryExpressions/PrimaryExpression.cs | 6 +- .../PrimaryExpressions/ValueDto.cs | 20 +++++ .../Impl/Nodes/Expressions/UnaryExpression.cs | 4 +- .../IR/Ast/Impl/Nodes/ScriptBody.cs | 13 ++- .../Impl/Nodes/Statements/BlockStatement.cs | 13 ++- .../Nodes/Statements/ExpressionStatement.cs | 4 +- .../Ast/Impl/Nodes/Statements/IfStatement.cs | 4 +- .../Nodes/Statements/InsideStatementJump.cs | 2 +- .../Impl/Nodes/Statements/ReturnStatement.cs | 4 +- .../Impl/Nodes/Statements/WhileStatement.cs | 4 +- src/HydraScript.Lib/IR/Ast/Scope.cs | 12 +++ .../Visitors/ExpressionInstructionProvider.cs | 84 ++++++++++--------- .../IR/Ast/Visitors/InstructionProvider.cs | 30 ++++--- .../Visitors/Services/IValueDtoConverter.cs | 9 ++ .../Services/Impl/ValueDtoConverter.cs | 18 ++++ .../IR/CheckSemantics/Variables/ISymbol.cs | 7 ++ .../CheckSemantics/Variables/ISymbolTable.cs | 34 ++++++++ .../Variables/Impl/SymbolTable.cs | 32 +++++++ .../{ => Impl}/Symbols/FunctionSymbol.cs | 16 ++-- .../Variables/Impl/Symbols/ObjectSymbol.cs | 11 +++ .../Variables/Impl/Symbols/Symbol.cs | 7 ++ .../Variables/Impl/Symbols/TypeSymbol.cs | 15 ++++ .../Variables/Impl/Symbols/VariableSymbol.cs | 12 +++ .../CheckSemantics/Variables/SymbolTable.cs | 41 --------- .../Variables/Symbols/ObjectSymbol.cs | 9 -- .../Variables/Symbols/Symbol.cs | 7 -- .../Variables/Symbols/TypeSymbol.cs | 24 ------ .../Variables/Symbols/VariableSymbol.cs | 10 --- .../Visitors/DeclarationVisitor.cs | 33 ++++---- .../Visitors/SemanticChecker.cs | 37 +++++--- .../IFunctionWithUndefinedReturnStorage.cs | 2 +- .../Services/IJavaScriptTypesProvider.cs | 2 + .../Visitors/Services/IMethodStorage.cs | 2 +- .../Services/IStandardLibraryProvider.cs | 2 +- .../ISymbolTableInitializerService.cs | 10 --- .../Visitors/Services/ISymbolTableStorage.cs | 13 +++ .../Impl/DefaultValueForTypeCalculator.cs | 2 +- .../FunctionWithUndefinedReturnStorage.cs | 4 +- .../Services/Impl/JavaScriptTypesProvider.cs | 24 +++--- .../Visitors/Services/Impl/MethodStorage.cs | 4 +- .../Services/Impl/StandardLibraryProvider.cs | 17 ++-- .../Impl/SymbolTableInitializerService.cs | 15 ---- .../Services/Impl/SymbolTableStorage.cs | 24 ++++++ .../Services/Impl/TypeDeclarationsResolver.cs | 22 +++-- .../Visitors/SymbolTableInitializer.cs | 26 +++--- .../IR/CheckSemantics/Visitors/TypeBuilder.cs | 47 +++++++++++ .../Visitors/TypeSystemLoader.cs | 22 +++-- src/HydraScript/Program.cs | 3 + .../Services/CodeGen/ICodeGenService.cs | 9 ++ .../Services/CodeGen/Impl/CodeGenService.cs | 75 +++++++++++++++++ .../Services/Executor/Impl/Executor.cs | 13 ++- .../Impl/LoggingAbstractSyntaxTree.cs | 29 ------- .../ParserProvider/Impl/LoggingParser.cs | 6 +- .../ParserProvider/Impl/ParserProvider.cs | 3 +- .../Helpers/ListExtensions.cs | 14 ---- .../Helpers/MockExtensions.cs | 16 ++-- .../TestData/InstructionsData.cs | 31 ++++--- .../BackEnd/AddressedInstructionsTests.cs | 34 ++++---- .../Unit/BackEnd/CallTests.cs | 7 +- .../Unit/BackEnd/HashAddressTests.cs | 2 +- .../Unit/BackEnd/InstructionsTests.cs | 11 +-- .../Unit/BackEnd/ValuesTests.cs | 2 +- .../Unit/BackEnd/VirtualMachineTests.cs | 79 +++++++++-------- ...FunctionWithUndefinedReturnStorageTests.cs | 4 +- .../Unit/IR/SymbolTableTests.cs | 39 +-------- .../Unit/Infrastructure/ExecutorTests.cs | 64 ++++++++++---- .../Infrastructure/LoggingEntitiesTests.cs | 31 +------ 138 files changed, 1203 insertions(+), 982 deletions(-) create mode 100644 src/HydraScript.Lib/BackEnd/Call.cs create mode 100644 src/HydraScript.Lib/BackEnd/Frame.cs rename src/HydraScript.Lib/BackEnd/{Addresses => }/IAddress.cs (65%) create mode 100644 src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs create mode 100644 src/HydraScript.Lib/BackEnd/IExecuteParams.cs rename src/HydraScript.Lib/BackEnd/{Values => }/IValue.cs (65%) create mode 100644 src/HydraScript.Lib/BackEnd/IVirtualMachine.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Addresses/HashAddress.cs (91%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Addresses/Label.cs (88%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/BlockLabel.cs (86%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/Instruction.cs (65%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/RemoveFromArray.cs (59%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/AsString.cs (74%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs (56%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs (55%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Read/DotRead.cs (64%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs (60%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs (64%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs (63%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithAssignment/Simple.cs (93%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithJump/Goto.cs (74%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Instructions/WithJump/IfNotGoto.cs (61%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Values/Constant.cs (90%) rename src/HydraScript.Lib/BackEnd/{ => Impl}/Values/Name.cs (85%) create mode 100644 src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/Halt.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/Print.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/Return.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs delete mode 100644 src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs delete mode 100644 src/HydraScript.Lib/BackEnd/VirtualMachine.cs delete mode 100644 src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs create mode 100644 src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Scope.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs create mode 100644 src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs rename src/HydraScript.Lib/IR/CheckSemantics/Variables/{ => Impl}/Symbols/FunctionSymbol.cs (55%) create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs create mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs create mode 100644 src/HydraScript/Services/CodeGen/ICodeGenService.cs create mode 100644 src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs delete mode 100644 src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs delete mode 100644 tests/HydraScript.Tests/Helpers/ListExtensions.cs diff --git a/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs b/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs index 42d36845..684594c5 100644 --- a/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs +++ b/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs @@ -1,16 +1,15 @@ using System.Collections; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Impl.Addresses; namespace HydraScript.Lib.BackEnd; -public class AddressedInstructions : IEnumerable +public class AddressedInstructions : IEnumerable { private readonly LinkedList _addresses = new(); private readonly Dictionary> _addressToNode = new(); - private readonly Dictionary, Instruction> _instructions = new(); + private readonly Dictionary, IExecutableInstruction> _instructions = new(); - public Instruction this[IAddress address] + public IExecutableInstruction this[IAddress address] { get => _instructions[_addressToNode[address]]; private set => _instructions[_addressToNode[address]] = value; @@ -22,7 +21,7 @@ public Instruction this[IAddress address] public IAddress End => _addresses.Last?.Value!; - public void Add(Instruction instruction, string? label = null) + public void Add(IExecutableInstruction instruction, string? label = null) { IAddress newAddress = label is null ? new HashAddress(seed: instruction.GetHashCode()) @@ -32,7 +31,7 @@ public void Add(Instruction instruction, string? label = null) AddWithAddress(instruction, newAddress); } - public void Replace(Instruction old, Instruction @new) + public void Replace(IExecutableInstruction old, IExecutableInstruction @new) { var address = old.Address; @new.Address = address; @@ -40,7 +39,7 @@ public void Replace(Instruction old, Instruction @new) this[address] = @new; } - private void AddWithAddress(Instruction instruction, IAddress newAddress) + private void AddWithAddress(IExecutableInstruction instruction, IAddress newAddress) { var last = _addresses.Last; if (last is not null) @@ -52,13 +51,13 @@ private void AddWithAddress(Instruction instruction, IAddress newAddress) _instructions.Add(newNode, instruction); } - public void AddRange(IEnumerable instructions) + public void AddRange(IEnumerable instructions) { foreach (var instruction in instructions) AddWithAddress(instruction, instruction.Address); } - public void Remove(Instruction instruction) + public void Remove(IExecutableInstruction instruction) { var address = instruction.Address; var nodeToRemove = _addressToNode[address]; @@ -74,7 +73,7 @@ public void Remove(Instruction instruction) _addresses.Remove(nodeToRemove); } - public IEnumerator GetEnumerator() => + public IEnumerator GetEnumerator() => _addresses.Select(address => this[address]) .GetEnumerator(); diff --git a/src/HydraScript.Lib/BackEnd/Call.cs b/src/HydraScript.Lib/BackEnd/Call.cs new file mode 100644 index 00000000..106bcfdd --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Call.cs @@ -0,0 +1,20 @@ +using HydraScript.Lib.BackEnd.Impl.Addresses; + +namespace HydraScript.Lib.BackEnd; + +public record Call( + IAddress From, + FunctionInfo To, + string? Where = null) +{ + public override string ToString() => + $"{From}: {Where} => {To.Start}: {To.Id}"; +} + +public record FunctionInfo(string Id) +{ + public Label Start => new($"Start_{this}"); + public Label End => new($"End_{this}"); + + public override string ToString() => Id; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Frame.cs b/src/HydraScript.Lib/BackEnd/Frame.cs new file mode 100644 index 00000000..d5e08427 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Frame.cs @@ -0,0 +1,16 @@ +namespace HydraScript.Lib.BackEnd; + +public class Frame(IAddress returnAddress, Frame? parentFrame = null) +{ + private readonly Dictionary _variables = new(); + + public IAddress ReturnAddress { get; } = returnAddress; + + public object? this[string id] + { + get => _variables.TryGetValue(id, out var value) + ? value + : parentFrame?[id]; + set => _variables[id] = value; + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Addresses/IAddress.cs b/src/HydraScript.Lib/BackEnd/IAddress.cs similarity index 65% rename from src/HydraScript.Lib/BackEnd/Addresses/IAddress.cs rename to src/HydraScript.Lib/BackEnd/IAddress.cs index df222575..ea9006a2 100644 --- a/src/HydraScript.Lib/BackEnd/Addresses/IAddress.cs +++ b/src/HydraScript.Lib/BackEnd/IAddress.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Addresses; +namespace HydraScript.Lib.BackEnd; public interface IAddress : IEquatable { diff --git a/src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs b/src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs new file mode 100644 index 00000000..13cfb1f8 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Lib.BackEnd; + +public interface IExecutableInstruction +{ + public IAddress Address { get; set; } + public IAddress Execute(IExecuteParams executeParams); + public bool End { get; } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/IExecuteParams.cs b/src/HydraScript.Lib/BackEnd/IExecuteParams.cs new file mode 100644 index 00000000..ecfe8ca4 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/IExecuteParams.cs @@ -0,0 +1,9 @@ +namespace HydraScript.Lib.BackEnd; + +public interface IExecuteParams +{ + public Stack CallStack { get; } + public Stack Frames { get; } + public Queue Arguments { get; } + public TextWriter Writer { get; } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Values/IValue.cs b/src/HydraScript.Lib/BackEnd/IValue.cs similarity index 65% rename from src/HydraScript.Lib/BackEnd/Values/IValue.cs rename to src/HydraScript.Lib/BackEnd/IValue.cs index ecafaf32..d08a9d88 100644 --- a/src/HydraScript.Lib/BackEnd/Values/IValue.cs +++ b/src/HydraScript.Lib/BackEnd/IValue.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd; public interface IValue : IEquatable { diff --git a/src/HydraScript.Lib/BackEnd/IVirtualMachine.cs b/src/HydraScript.Lib/BackEnd/IVirtualMachine.cs new file mode 100644 index 00000000..f247273b --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/IVirtualMachine.cs @@ -0,0 +1,7 @@ +namespace HydraScript.Lib.BackEnd; + +public interface IVirtualMachine +{ + public IExecuteParams ExecuteParams { get; } + public void Run(AddressedInstructions instructions); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs b/src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs similarity index 91% rename from src/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs rename to src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs index a2e6f701..9dbde339 100644 --- a/src/HydraScript.Lib/BackEnd/Addresses/HashAddress.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Addresses; +namespace HydraScript.Lib.BackEnd.Impl.Addresses; public class HashAddress(int seed) : IAddress { diff --git a/src/HydraScript.Lib/BackEnd/Addresses/Label.cs b/src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs similarity index 88% rename from src/HydraScript.Lib/BackEnd/Addresses/Label.cs rename to src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs index 912d7cfe..5622620e 100644 --- a/src/HydraScript.Lib/BackEnd/Addresses/Label.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Addresses; +namespace HydraScript.Lib.BackEnd.Impl.Addresses; public class Label(string name) : IAddress { diff --git a/src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs b/src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs new file mode 100644 index 00000000..619a70aa --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs @@ -0,0 +1,9 @@ +namespace HydraScript.Lib.BackEnd.Impl; + +public class ExecuteParams(TextWriter textWriter) : IExecuteParams +{ + public Stack CallStack { get; } = new(); + public Stack Frames { get; } = new(); + public Queue Arguments { get; } = new(); + public TextWriter Writer { get; } = textWriter; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs similarity index 86% rename from src/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs index 46c528fb..efd7d66f 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/BlockLabel.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs @@ -1,6 +1,4 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd.Instructions; +namespace HydraScript.Lib.BackEnd.Impl.Instructions; public abstract class BlockLabel : Instruction { @@ -15,7 +13,7 @@ protected BlockLabel(BlockPosition blockPosition, BlockType blockType, string bl _blockId = blockId; } - public override IAddress Execute(VirtualMachine vm) => + public override IAddress Execute(IExecuteParams executeParams) => Address.Next; protected override string ToStringInternal() => diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs new file mode 100644 index 00000000..69d677e8 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs @@ -0,0 +1,16 @@ +using HydraScript.Lib.BackEnd.Impl.Addresses; + +namespace HydraScript.Lib.BackEnd.Impl.Instructions; + +public class Halt : Instruction +{ + public override bool End => true; + + public override IAddress Execute(IExecuteParams executeParams) + { + executeParams.Frames.Pop(); + return new HashAddress(seed: 0); + } + + protected override string ToStringInternal() => "End"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/Instruction.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs similarity index 65% rename from src/HydraScript.Lib/BackEnd/Instructions/Instruction.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs index fb8931a8..6c785e80 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/Instruction.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs @@ -1,8 +1,6 @@ -using HydraScript.Lib.BackEnd.Addresses; +namespace HydraScript.Lib.BackEnd.Impl.Instructions; -namespace HydraScript.Lib.BackEnd.Instructions; - -public abstract class Instruction +public abstract class Instruction : IExecutableInstruction { private IAddress _address = default!; @@ -18,9 +16,9 @@ public IAddress Address protected virtual void OnSetOfAddress(IAddress address) { } - public abstract IAddress Execute(VirtualMachine vm); + public abstract IAddress Execute(IExecuteParams executeParams); - public virtual bool End() => false; + public virtual bool End => false; protected abstract string ToStringInternal(); diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs new file mode 100644 index 00000000..037113dd --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs @@ -0,0 +1,14 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions; + +public class PopParameter(string parameter) : Instruction +{ + public override IAddress Execute(IExecuteParams executeParams) + { + var argument = executeParams.Arguments.Dequeue(); + executeParams.Frames.Peek()[parameter] = argument; + return Address.Next; + } + + protected override string ToStringInternal() => + $"PopParameter {parameter}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs new file mode 100644 index 00000000..576e01d7 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs @@ -0,0 +1,13 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions; + +public class Print(IValue value) : Instruction +{ + public override IAddress Execute(IExecuteParams executeParams) + { + executeParams.Writer.WriteLine(value.Get(executeParams.Frames.Peek())); + return Address.Next; + } + + protected override string ToStringInternal() => + $"Print {value}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs new file mode 100644 index 00000000..a790e160 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs @@ -0,0 +1,14 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions; + +public class PushParameter(IValue value) : Instruction +{ + public override IAddress Execute(IExecuteParams executeParams) + { + executeParams.Arguments.Enqueue( + value.Get(executeParams.Frames.Peek())); + return Address.Next; + } + + protected override string ToStringInternal() => + $"PushParameter {value}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs similarity index 59% rename from src/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs index ad0f3ec5..6a42591d 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/RemoveFromArray.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs @@ -1,13 +1,10 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions; +namespace HydraScript.Lib.BackEnd.Impl.Instructions; public class RemoveFromArray(string id, IValue index) : Instruction { - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); if (frame[id] is List list) { list.RemoveAt(Convert.ToInt32(index.Get(frame))); diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs new file mode 100644 index 00000000..be8acfb6 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs @@ -0,0 +1,19 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions; + +public class Return(IValue? value = null) : Instruction +{ + public override IAddress Execute(IExecuteParams executeParams) + { + var frame = executeParams.Frames.Pop(); + var call = executeParams.CallStack.Pop(); + if (call.Where != null && value != null) + { + executeParams.Frames.Peek()[call.Where] = value.Get(frame); + } + + return frame.ReturnAddress; + } + + protected override string ToStringInternal() => + $"Return{(value != null ? $" {value}" : "")}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs similarity index 74% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs index 83db00e3..183ffe13 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/AsString.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs @@ -1,15 +1,13 @@ using System.Text.Json; using System.Text.Json.Serialization; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; public class AsString(IValue value) : Simple(value) { - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); frame[Left!] = JsonSerializer.Serialize( Right.right!.Get(frame), new JsonSerializerOptions diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs new file mode 100644 index 00000000..cbd540bd --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs @@ -0,0 +1,24 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; + +public class CallFunction( + FunctionInfo function, + bool hasReturnValue) : Simple(null, (null, null), "Call ") +{ + protected override void OnSetOfAddress(IAddress address) + { + if (hasReturnValue) + base.OnSetOfAddress(address); + } + + public override IAddress Execute(IExecuteParams executeParams) + { + var frame = new Frame(Address.Next, executeParams.Frames.Peek()); + executeParams.CallStack.Push(new Call(Address, function, Left)); + executeParams.Frames.Push(frame); + return function.Start; + } + + protected override string ToStringInternal() => Left == null + ? $"Call {function}" + : $"{Left} = Call {function}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs similarity index 56% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs index edba4ace..756bb1ef 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs @@ -1,14 +1,12 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; public class CreateArray(string id, int size) : Simple(id) { private readonly string _id = id; - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); frame[_id] = new object[size].ToList(); return Address.Next; } diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs similarity index 55% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs index 913aafb5..c2647d2d 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs @@ -1,14 +1,12 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; public class CreateObject(string id) : Simple(id) { private readonly string _id = id; - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); frame[_id] = new Dictionary(); return Address.Next; } diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs similarity index 64% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs index 18d906a4..85dad652 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/DotRead.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; public class DotRead(Name @object, IValue property) : Simple( leftValue: @object, @@ -15,7 +15,7 @@ public class DotRead(Name @object, IValue property) : Simple( public Simple ToAssignment(IValue value) => new DotAssignment(@object.ToString(), _property, value); - public Instruction ToInstruction() => this; + public IExecutableInstruction ToInstruction() => this; protected override string ToStringInternal() => $"{Left} = {@object}.{_property}"; diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs new file mode 100644 index 00000000..6ec8afbd --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; + +public interface IReadFromComplexData +{ + Simple ToAssignment(IValue value); + + IExecutableInstruction ToInstruction(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs similarity index 60% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs index b0ac6c81..c87dda1e 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; public class IndexRead(Name array, IValue index) : Simple( leftValue: array, @@ -13,7 +13,7 @@ public class IndexRead(Name array, IValue index) : Simple( public Simple ToAssignment(IValue value) => new IndexAssignment(array.ToString(), _index, value); - public Instruction ToInstruction() => this; + public IExecutableInstruction ToInstruction() => this; protected override string ToStringInternal() => $"{Left} = {array}[{_index}]"; diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs similarity index 64% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs index aa9e303a..2a6bd290 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs @@ -1,15 +1,14 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; public class DotAssignment(string @object, IValue property, IValue value) : Simple(left: @object, (property, value), "."), IWriteToComplexData { - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); if (frame[Left!] is Dictionary obj) { var field = (string?)Right.left?.Get(frame) ?? string.Empty; diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs new file mode 100644 index 00000000..2a007f8f --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; + +public interface IWriteToComplexData +{ + Simple ToSimple(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs similarity index 63% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs index c2b6d561..b3eae1a5 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs @@ -1,15 +1,14 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; public class IndexAssignment(string array, IValue index, IValue value) : Simple(left: array, right: (index, value), "[]"), IWriteToComplexData { - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); if (frame[Left!] is List list) { var index = Convert.ToInt32(Right.left!.Get(frame)); diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs similarity index 93% rename from src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs index 3a280282..ad3cb042 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/Simple.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs @@ -1,7 +1,4 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; public class Simple : Instruction { @@ -50,9 +47,9 @@ public Simple( protected override void OnSetOfAddress(IAddress address) => Left ??= $"_t{unchecked((uint)address.GetHashCode())}"; - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); if (Right.left == null) { var value = Right.right!.Get(frame); diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs similarity index 74% rename from src/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs index 136e6d64..bab94fc4 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithJump/Goto.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd.Instructions.WithJump; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; public class Goto : Instruction { @@ -14,7 +14,7 @@ public Goto(Label jump) => public Goto(InsideStatementJumpType jumpType) => JumpType = jumpType; - public override IAddress Execute(VirtualMachine vm) => + public override IAddress Execute(IExecuteParams executeParams) => Jump; public void SetJump(Label newJump) => diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs similarity index 61% rename from src/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs rename to src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs index 5e58816b..baff1559 100644 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithJump/IfNotGoto.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs @@ -1,7 +1,6 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd.Instructions.WithJump; +namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; public class IfNotGoto : Goto { @@ -11,9 +10,9 @@ public IfNotGoto(IValue test, Label jump) : base(jump) => _test = test; - public override IAddress Execute(VirtualMachine vm) + public override IAddress Execute(IExecuteParams executeParams) { - var frame = vm.Frames.Peek(); + var frame = executeParams.Frames.Peek(); return !Convert.ToBoolean(_test.Get(frame)) ? Jump : Address.Next; diff --git a/src/HydraScript.Lib/BackEnd/Values/Constant.cs b/src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs similarity index 90% rename from src/HydraScript.Lib/BackEnd/Values/Constant.cs rename to src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs index 1ba5b4c0..3c3aef52 100644 --- a/src/HydraScript.Lib/BackEnd/Values/Constant.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd.Impl.Values; public class Constant(object? value, string representation) : IValue { diff --git a/src/HydraScript.Lib/BackEnd/Values/Name.cs b/src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs similarity index 85% rename from src/HydraScript.Lib/BackEnd/Values/Name.cs rename to src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs index 570641d0..61ebd705 100644 --- a/src/HydraScript.Lib/BackEnd/Values/Name.cs +++ b/src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Values; +namespace HydraScript.Lib.BackEnd.Impl.Values; public class Name(string id) : IValue { diff --git a/src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs b/src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs new file mode 100644 index 00000000..559e8a46 --- /dev/null +++ b/src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs @@ -0,0 +1,21 @@ +namespace HydraScript.Lib.BackEnd.Impl; + +public class VirtualMachine(TextWriter writer) : IVirtualMachine +{ + public IExecuteParams ExecuteParams { get; } = new ExecuteParams(writer); + + public void Run(AddressedInstructions instructions) + { + ExecuteParams.Frames.Push(new Frame(instructions.Start)); + + var address = instructions.Start; + while (!instructions[address].End) + { + var instruction = instructions[address]; + var jump = instruction.Execute(ExecuteParams); + address = jump; + } + + instructions[address].Execute(ExecuteParams); + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/Halt.cs b/src/HydraScript.Lib/BackEnd/Instructions/Halt.cs deleted file mode 100644 index b2757935..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/Halt.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd.Instructions; - -public class Halt : Instruction -{ - public override bool End() => true; - - public override IAddress Execute(VirtualMachine vm) - { - vm.Frames.Pop(); - return new HashAddress(seed: 0); - } - - protected override string ToStringInternal() => "End"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/Print.cs b/src/HydraScript.Lib/BackEnd/Instructions/Print.cs deleted file mode 100644 index 7ecafbd8..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/Print.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions; - -public class Print : Instruction -{ - private readonly IValue _value; - - public Print(IValue value) => - _value = value; - - public override IAddress Execute(VirtualMachine vm) - { - vm.Writer.WriteLine(_value.Get(vm.Frames.Peek())); - return Address.Next; - } - - protected override string ToStringInternal() => - $"Print {_value}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs b/src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs deleted file mode 100644 index ae3125b1..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/PushParameter.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions; - -public class PushParameter(string parameter, IValue value) : Instruction -{ - public override IAddress Execute(VirtualMachine vm) - { - vm.Arguments.Push((parameter, value.Get(vm.Frames.Peek()))); - return Address.Next; - } - - protected override string ToStringInternal() => - $"PushParameter {parameter} = {value}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/Return.cs b/src/HydraScript.Lib/BackEnd/Instructions/Return.cs deleted file mode 100644 index a9afaea5..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/Return.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions; - -public class Return(IValue? value = null) : Instruction -{ - public override IAddress Execute(VirtualMachine vm) - { - var frame = vm.Frames.Pop(); - var call = vm.CallStack.Pop(); - if (call.Where != null && value != null) - { - vm.Frames.Peek()[call.Where] = value.Get(frame); - } - - return frame.ReturnAddress; - } - - protected override string ToStringInternal() => - $"Return{(value != null ? $" {value}" : "")}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs deleted file mode 100644 index 03e2ab61..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/CallFunction.cs +++ /dev/null @@ -1,49 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment; - -public class CallFunction : Simple -{ - private readonly FunctionInfo _function; - private readonly int _numberOfArguments; - private readonly bool _hasReturnValue; - - public CallFunction( - FunctionInfo function, - int numberOfArguments, - bool hasReturnValue) : - base(null, (null, null), "Call ") - { - _function = function; - _numberOfArguments = numberOfArguments; - _hasReturnValue = hasReturnValue; - } - - protected override void OnSetOfAddress(IAddress address) - { - if (_hasReturnValue) - base.OnSetOfAddress(address); - } - - public override IAddress Execute(VirtualMachine vm) - { - var frame = new Frame(Address.Next, vm.Frames.Peek()); - - var i = 0; - var args = new List<(string Id, object? Value)>(); - while (i < _numberOfArguments) - { - args.Add(vm.Arguments.Pop()); - frame[args[i].Id] = args[i].Value; - i++; - } - - vm.CallStack.Push(new Call(Address, _function, args, Left)); - vm.Frames.Push(frame); - return _function.Start; - } - - protected override string ToStringInternal() => Left == null - ? $"Call {_function}, {_numberOfArguments}" - : $"{Left} = Call {_function}, {_numberOfArguments}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs deleted file mode 100644 index e9e0c816..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HydraScript.Lib.BackEnd.Values; - -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; - -public interface IReadFromComplexData -{ - Simple ToAssignment(IValue value); - - Instruction ToInstruction(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs deleted file mode 100644 index ac1531f1..00000000 --- a/src/HydraScript.Lib/BackEnd/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; - -public interface IWriteToComplexData -{ - Simple ToSimple(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/VirtualMachine.cs b/src/HydraScript.Lib/BackEnd/VirtualMachine.cs deleted file mode 100644 index 020191f4..00000000 --- a/src/HydraScript.Lib/BackEnd/VirtualMachine.cs +++ /dev/null @@ -1,63 +0,0 @@ -using HydraScript.Lib.BackEnd.Addresses; - -namespace HydraScript.Lib.BackEnd; - -public record VirtualMachine( - Stack CallStack, Stack Frames, - Stack<(string Id, object? Value)> Arguments, - TextWriter Writer -) -{ - public VirtualMachine() : - this(new(), new(), new(), Console.Out) { } - - public void Run(AddressedInstructions instructions) - { - Frames.Push(new Frame(instructions.Start)); - - var address = instructions.Start; - while (!instructions[address].End()) - { - var instruction = instructions[address]; - var jump = instruction.Execute(this); - address = jump; - } - - instructions[address].Execute(this); - } -} - -public record Call( - IAddress From, FunctionInfo To, - List<(string Id, object? Value)> Parameters, - string? Where = null) -{ - public override string ToString() => - $"{From} => {To.Start}: {To.Id}({string.Join(", ", Parameters.Select(x => $"{x.Id}: {x.Value}"))})"; -} - -public record FunctionInfo(string Id) -{ - public Label Start => - new($"Start_{this}"); - - public Label End => - new($"End_{this}"); - - public override string ToString() => Id; -} - -public class Frame(IAddress returnAddress, Frame? parentFrame = null) -{ - private readonly Dictionary _variables = new(); - - public IAddress ReturnAddress { get; } = returnAddress; - - public object? this[string id] - { - get => _variables.TryGetValue(id, out var value) - ? value - : parentFrame?[id]; - set => _variables[id] = value; - } -} \ No newline at end of file diff --git a/src/HydraScript.Lib/HydraScript.Lib.csproj b/src/HydraScript.Lib/HydraScript.Lib.csproj index 83689500..0783a6a6 100644 --- a/src/HydraScript.Lib/HydraScript.Lib.csproj +++ b/src/HydraScript.Lib/HydraScript.Lib.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs deleted file mode 100644 index fa4eed5a..00000000 --- a/src/HydraScript.Lib/IR/Ast/AbstractSyntaxTreeNode.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections; -using HydraScript.Lib.IR.CheckSemantics.Variables; - -namespace HydraScript.Lib.IR.Ast; - -public abstract class AbstractSyntaxTreeNode : - IReadOnlyList, - IVisitable -{ - public AbstractSyntaxTreeNode Parent { get; set; } = default!; - - protected virtual bool IsRoot => false; - - public SymbolTable SymbolTable { get; set; } = default!; - - public string Segment { get; init; } = string.Empty; - - protected virtual IReadOnlyList Children { get; } = []; - - public IEnumerator GetEnumerator() => - Children.ToList().GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => - GetEnumerator(); - - public int Count => Children.Count; - - public AbstractSyntaxTreeNode this[int index] => - Children[index]; - - internal List GetAllNodes() - { - List result = [this]; - for (var index = 0; index < Children.Count; index++) - result.AddRange(Children[index].GetAllNodes()); - - return result; - } - - public bool ChildOf() where T : AbstractSyntaxTreeNode - { - var parent = Parent; - while (!parent.IsRoot) - { - if (parent is T) - { - return true; - } - - parent = parent.Parent; - } - - return false; - } - - public virtual TReturn Accept(IVisitor visitor) => - visitor.DefaultVisit; - - protected abstract string NodeRepresentation(); - - public override string ToString() => - $"{GetHashCode()} [label=\"{NodeRepresentation()}\"]"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs b/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs index 9657cf9d..d29b3fef 100644 --- a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs +++ b/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs @@ -1,8 +1,6 @@ -using HydraScript.Lib.BackEnd; - namespace HydraScript.Lib.IR.Ast; public interface IAbstractSyntaxTree { - AddressedInstructions GetInstructions(); + public IAbstractSyntaxTreeNode Root { get; } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs new file mode 100644 index 00000000..5de9cab2 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs @@ -0,0 +1,11 @@ +namespace HydraScript.Lib.IR.Ast; + +public interface IAbstractSyntaxTreeNode : + IReadOnlyList, + IVisitable +{ + public IAbstractSyntaxTreeNode Parent { get; } + public Scope Scope { get; } + public void InitScope(Scope? scope = null); + public IReadOnlyList GetAllNodes(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs index 011dae26..a0f3a07b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs @@ -1,63 +1,25 @@ using System.Text; -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; namespace HydraScript.Lib.IR.Ast.Impl; -public class AbstractSyntaxTree : IAbstractSyntaxTree +internal class AbstractSyntaxTree(IAbstractSyntaxTreeNode root) : IAbstractSyntaxTree { - private readonly AbstractSyntaxTreeNode _root; - - private readonly IVisitor _symbolTableInitializer; - private readonly IVisitor _typeSystemLoader; - private readonly IVisitor _declarationVisitor; - - private readonly IVisitor _semanticChecker; - private readonly IVisitor _instructionProvider; - - public AbstractSyntaxTree(AbstractSyntaxTreeNode root) - { - _root = root; - var functionStorage = new FunctionWithUndefinedReturnStorage(); - var methodStorage = new MethodStorage(); - - _symbolTableInitializer = new SymbolTableInitializer( - new SymbolTableInitializerService(), - new StandardLibraryProvider( - new JavaScriptTypesProvider())); - _typeSystemLoader = new TypeSystemLoader( - new TypeDeclarationsResolver( - new JavaScriptTypesProvider()), - new JavaScriptTypesProvider()); - _declarationVisitor = new DeclarationVisitor(functionStorage, methodStorage); - - _semanticChecker = new SemanticChecker( - new DefaultValueForTypeCalculator(), - functionStorage, - methodStorage); - _instructionProvider = new InstructionProvider(); - } - - public AddressedInstructions GetInstructions() - { - _root.Accept(_symbolTableInitializer); - _root.Accept(_typeSystemLoader); - _root.Accept(_declarationVisitor); - - _root.Accept(_semanticChecker); - return _root.Accept(_instructionProvider); - } + public IAbstractSyntaxTreeNode Root { get; } = root; public override string ToString() { var tree = new StringBuilder("digraph ast {\n"); - _root.GetAllNodes().ForEach(node => + var nodes = Root.GetAllNodes(); + for (var i = 0; i < nodes.Count; i++) { + var node = nodes[i]; tree.Append('\t').Append(node).Append('\n'); - node.ToList().ForEach(child => tree.Append($"\t{node.GetHashCode()}->{child.GetHashCode()}\n")); - }); + for (var j = 0; j < node.Count; j++) + { + var child = node[j]; + tree.Append($"\t{node.GetHashCode()}->{child.GetHashCode()}\n"); + } + } return tree.Append("}\n").ToString(); } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs new file mode 100644 index 00000000..a62e5e61 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs @@ -0,0 +1,66 @@ +using System.Collections; + +namespace HydraScript.Lib.IR.Ast.Impl; + +public abstract class AbstractSyntaxTreeNode : IAbstractSyntaxTreeNode +{ + public IAbstractSyntaxTreeNode Parent { get; set; } = default!; + + public Scope Scope { get; protected set; } = default!; + + /// Базовая стратегия - инициализация через родительский узел + /// Обязательно null + public virtual void InitScope(Scope? scope = null) + { + if (scope is not null) + throw new ArgumentException("'scope' must be null"); + Scope = Parent.Scope; + } + + public string Segment { get; init; } = string.Empty; + + protected virtual IReadOnlyList Children { get; } = []; + + public IEnumerator GetEnumerator() => + Children.ToList().GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => + GetEnumerator(); + + public int Count => Children.Count; + + public IAbstractSyntaxTreeNode this[int index] => + Children[index]; + + public IReadOnlyList GetAllNodes() + { + List result = [this]; + for (var index = 0; index < Children.Count; index++) + result.AddRange(Children[index].GetAllNodes()); + + return result; + } + + public bool ChildOf() where T : IAbstractSyntaxTreeNode + { + var parent = Parent; + while (parent != default!) + { + if (parent is T) + { + return true; + } + + parent = parent.Parent; + } + + return false; + } + + public virtual TReturn Accept(IVisitor visitor) => + visitor.DefaultVisit; + + protected abstract string NodeRepresentation(); + public override string ToString() => + $"{GetHashCode()} [label=\"{NodeRepresentation()}\"]"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs index 57261a54..e603b490 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs @@ -3,5 +3,5 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; public abstract class AfterTypesAreLoadedDeclaration : Declaration { public abstract override TReturn Accept( - IVisitor visitor); + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs index 0d2c02e3..c644b3fd 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -3,15 +3,19 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -[AutoVisitable] +[AutoVisitable] public partial class FunctionDeclaration : AfterTypesAreLoadedDeclaration { - protected override IReadOnlyList Children => [Statements]; + private readonly List _arguments; + + protected override IReadOnlyList Children => [Statements]; public IdentifierReference Name { get; } public TypeValue ReturnTypeValue { get; } - public List Arguments { get; } + public IReadOnlyList Arguments => _arguments; + public BlockStatement Statements { get; } + public bool IsEmpty => Statements.Count == 0; public FunctionDeclaration( IdentifierReference name, @@ -21,7 +25,7 @@ public FunctionDeclaration( { Name = name; ReturnTypeValue = returnTypeValue; - Arguments = arguments; + _arguments = arguments; Statements = blockStatement; Statements.Parent = this; @@ -32,6 +36,18 @@ public FunctionDeclaration( .ToArray(); } + /// Стратегия "блока" - углубление скоупа + /// Новый скоуп + public override void InitScope(Scope? scope = null) + { + ArgumentNullException.ThrowIfNull(scope); + Scope = scope; + Scope.AddOpenScope(Parent.Scope); + + _arguments.ForEach(x => x.TypeValue.Scope = Parent.Scope); + ReturnTypeValue.Scope = Parent.Scope; + } + public bool HasReturnStatement() => ReturnStatements.Count > 0; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs index aa38d093..3adb8ed1 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs @@ -2,11 +2,11 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -[AutoVisitable] +[AutoVisitable] public partial class LexicalDeclaration(bool readOnly) : AfterTypesAreLoadedDeclaration { private readonly List _assignments = []; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => _assignments; public bool ReadOnly { get; } = readOnly; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs index cca75678..3fcbe51a 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs @@ -2,14 +2,19 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -[AutoVisitable] +[AutoVisitable] public partial class TypeDeclaration(IdentifierReference typeId, TypeValue typeValue) : Declaration { public IdentifierReference TypeId { get; } = typeId; + public TypeValue TypeValue { get; } = typeValue; - public Type BuildType() => - typeValue.BuildType(SymbolTable); + /// + public override void InitScope(Scope? scope = null) + { + base.InitScope(scope); + TypeValue.Scope = Scope; + } protected override string NodeRepresentation() => - $"type {TypeId.Name} = {typeValue}"; + $"type {TypeId.Name} = {TypeValue}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs index 9f5c69aa..2352c724 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs @@ -1,38 +1,28 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -public abstract record TypeValue +public abstract record TypeValue : IVisitable { - public abstract Type BuildType(SymbolTable symbolTable); + public Scope Scope { get; set; } = default!; + public abstract TReturn Accept(IVisitor visitor); } -public record TypeIdentValue(IdentifierReference TypeId) : TypeValue +[AutoVisitable] +public partial record TypeIdentValue(IdentifierReference TypeId) : TypeValue { - public override Type BuildType(SymbolTable symbolTable) => - symbolTable.FindSymbol(TypeId)?.Type ?? - throw new UnknownIdentifierReference(TypeId); - public override string ToString() => TypeId; } -public record ArrayTypeValue(TypeValue TypeValue) : TypeValue +[AutoVisitable] +public partial record ArrayTypeValue(TypeValue TypeValue) : TypeValue { - public override Type BuildType(SymbolTable symbolTable) => - new ArrayType(TypeValue.BuildType(symbolTable)); - public override string ToString() => $"{TypeValue}[]"; } -public record NullableTypeValue(TypeValue TypeValue) : TypeValue +[AutoVisitable] +public partial record NullableTypeValue(TypeValue TypeValue) : TypeValue { - public override Type BuildType(SymbolTable symbolTable) => - new NullableType(TypeValue.BuildType(symbolTable)); - public override string ToString() => $"{TypeValue}?"; } @@ -44,15 +34,10 @@ public override string ToString() => $"{Key}: {TypeValue}"; } -public record ObjectTypeValue( +[AutoVisitable] +public partial record ObjectTypeValue( IEnumerable Properties) : TypeValue { - public override Type BuildType(SymbolTable symbolTable) => - new ObjectType( - Properties.Select(x => new PropertyType( - Id: x.Key, - x.TypeValue.BuildType(symbolTable)))); - public override string ToString() => $"{{{string.Join(';', Properties)}}}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs index 8e2c8185..2a6e112b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs @@ -25,5 +25,5 @@ public bool HasPrev() => Prev is not null; public abstract override TReturn Accept( - IVisitor visitor); + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs index 94054711..99c3833a 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -2,10 +2,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -[AutoVisitable] +[AutoVisitable] public partial class DotAccess : AccessExpression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => HasNext() ? [Property, Next!] : [Property]; public IdentifierReference Property { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs index 1a74d2a0..c71ec0c6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -[AutoVisitable] +[AutoVisitable] public partial class IndexAccess : AccessExpression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => HasNext() ? [Index, Next!] : [Index]; public Expression Index { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs index 4e5e0966..9d48e1eb 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs @@ -2,10 +2,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class AssignmentExpression : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Destination, Source]; public LeftHandSideExpression Destination { get; } @@ -26,5 +26,13 @@ public AssignmentExpression( DestinationType = destinationType; } + /// + public override void InitScope(Scope? scope = null) + { + base.InitScope(scope); + if (DestinationType is not null) + DestinationType.Scope = Scope; + } + protected override string NodeRepresentation() => "="; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs index 0acb152a..fc65d5f7 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class BinaryExpression : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Left, Right]; public Expression Left { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs index eeb07276..48610acf 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs @@ -2,17 +2,20 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class CallExpression : LeftHandSideExpression { private readonly List _parameters; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Member, .._parameters]; public MemberExpression Member { get; } public IReadOnlyList Parameters => _parameters; + public bool IsEmptyCall { get; set; } + public bool HasReturnValue { get; set; } + public CallExpression(MemberExpression member, IEnumerable expressions) { Member = member; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs index 72ed955b..ba5b356f 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs @@ -2,10 +2,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class CastAsExpression : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Expression]; public Expression Expression { get; } @@ -19,5 +19,12 @@ public CastAsExpression(Expression expression, TypeValue cast) Cast = cast; } + /// + public override void InitScope(Scope? scope = null) + { + base.InitScope(scope); + Cast.Scope = Scope; + } + protected override string NodeRepresentation() => $"as {Cast}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs index 6c96ca32..0a0db176 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs @@ -1,11 +1,11 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -[AutoVisitable] +[AutoVisitable] public partial class ArrayLiteral : ComplexLiteral { private readonly List _expressions; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => _expressions; public IReadOnlyList Expressions => _expressions; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs index 4724abaf..279e21cc 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs @@ -1,11 +1,11 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -[AutoVisitable] +[AutoVisitable] public partial class ObjectLiteral : ComplexLiteral { private readonly List _properties; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => _properties; public IReadOnlyList Properties => _properties; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs index 21db416f..fd4968be 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs @@ -2,10 +2,10 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -[AutoVisitable] +[AutoVisitable] public partial class Property : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Id, Expression]; public IdentifierReference Id { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs index 1d32ab8b..589e8417 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class ConditionalExpression : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Test, Consequent, Alternate]; public Expression Test { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs index 613ba9fa..3883921d 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs @@ -3,5 +3,5 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; public abstract class Expression : AbstractSyntaxTreeNode { public abstract override TReturn Accept( - IVisitor visitor); + IVisitor visitor); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs index 8aa041ef..e8baa36b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs @@ -3,12 +3,12 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class MemberExpression : LeftHandSideExpression { private readonly IdentifierReference _identifierReference; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => AccessChain is not null ? [Id, AccessChain] : [Id]; public AccessExpression? AccessChain { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs new file mode 100644 index 00000000..9d70c5ab --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs @@ -0,0 +1,15 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; + +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public abstract class AbstractLiteral(TypeValue type) : PrimaryExpression +{ + public TypeValue Type { get; } = type; + + /// + public override void InitScope(Scope? scope = null) + { + base.InitScope(scope); + Type.Scope = Parent.Scope; + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs index cc61ae9f..26bc3690 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs @@ -1,15 +1,14 @@ -using HydraScript.Lib.BackEnd.Values; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -[AutoVisitable] +[AutoVisitable] public partial class IdentifierReference(string name) : PrimaryExpression { public string Name { get; } = name; protected override string NodeRepresentation() => Name; - public override IValue ToValue() => new Name(Name); + public override ValueDto ToValueDto() => + ValueDto.NameDto(Name); public static implicit operator string(IdentifierReference identifierReference) => identifierReference.Name; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs index 7d3d6df2..caca3143 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs @@ -1,19 +1,17 @@ -using HydraScript.Lib.BackEnd.Values; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -[AutoVisitable] -public partial class ImplicitLiteral(TypeValue typeValue) : PrimaryExpression +[AutoVisitable] +public partial class ImplicitLiteral(TypeValue type) : AbstractLiteral(type) { - public TypeValue TypeValue { get; } = typeValue; public object? ComputedDefaultValue { private get; set; } protected override string NodeRepresentation() => - TypeValue.ToString(); + Type.ToString(); - public override IValue ToValue() => - new Constant( + public override ValueDto ToValueDto() => + ValueDto.ConstantDto( ComputedDefaultValue, ComputedDefaultValue is null ? "null" diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs index 358f31a6..6162dc99 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs @@ -1,23 +1,19 @@ -using HydraScript.Lib.BackEnd.Values; -using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -[AutoVisitable] -public partial class Literal : PrimaryExpression +[AutoVisitable] +public partial class Literal : AbstractLiteral { - public TypeValue Type { get; } private readonly object? _value; private readonly string _label; public Literal( TypeValue type, object? value, - Segment segment, - string? label = null) + string segment, + string? label = null) : base(type) { - Type = type; _label = (label ?? value?.ToString())!; _value = value; Segment = segment; @@ -25,6 +21,6 @@ public Literal( protected override string NodeRepresentation() => _label; - public override IValue ToValue() => - new Constant(_value, _label); + public override ValueDto ToValueDto() => + ValueDto.ConstantDto(_value, _label); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs index 58805daa..ceb4f229 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs @@ -1,9 +1,7 @@ -using HydraScript.Lib.BackEnd.Values; - namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -[AutoVisitable] +[AutoVisitable] public abstract partial class PrimaryExpression : Expression { - public abstract IValue ToValue(); + public abstract ValueDto ToValueDto(); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs new file mode 100644 index 00000000..d66c0661 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs @@ -0,0 +1,20 @@ +namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +public record ValueDto( + ValueDtoType Type, + string? Name, + object? Value, + string? Label) +{ + public static ValueDto NameDto(string name) => + new(ValueDtoType.Name, name, Value: null, Label: null); + + public static ValueDto ConstantDto(object? value, string label) => + new(ValueDtoType.Constant, Name: null, value, label); +}; + +public enum ValueDtoType +{ + Constant = 1, + Name = 2 +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs index 4de499d6..2e59e417 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -[AutoVisitable] +[AutoVisitable] public partial class UnaryExpression : Expression { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Expression]; public string Operator { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs index 39f7e4a5..610daee0 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs @@ -1,13 +1,12 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes; -[AutoVisitable] +[AutoVisitable] public partial class ScriptBody : AbstractSyntaxTreeNode { private readonly List _statementList; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => _statementList; - protected override bool IsRoot => true; public IReadOnlyList StatementList => _statementList; @@ -17,5 +16,13 @@ public ScriptBody(IEnumerable statementList) _statementList.ForEach(item => item.Parent = this); } + /// В корень дерева загружается стандартная библиотека + /// Скоуп std + public override void InitScope(Scope? scope = null) + { + ArgumentNullException.ThrowIfNull(scope); + Scope = scope; + } + protected override string NodeRepresentation() => "Script"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs index 852e69e5..2c4979e3 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs @@ -1,11 +1,11 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class BlockStatement : Statement { private readonly List _statementList; - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => _statementList; public IReadOnlyList StatementList => _statementList; @@ -16,5 +16,14 @@ public BlockStatement(IEnumerable statementList) _statementList.ForEach(item => item.Parent = this); } + /// Стратегия "блока" - углубление скоупа + /// Новый скоуп + public override void InitScope(Scope? scope = null) + { + ArgumentNullException.ThrowIfNull(scope); + Scope = scope; + Scope.AddOpenScope(Parent.Scope); + } + protected override string NodeRepresentation() => "{}"; } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs index e0f80006..abedd82b 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class ExpressionStatement : Statement { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Expression]; public Expression Expression { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs index e590ff72..499dcaf0 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class IfStatement : Statement { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => Else is not null ? [Test, Then, Else] : [Test, Then]; public Expression Test { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs index 3fe93305..d1e397e7 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs @@ -1,6 +1,6 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class InsideStatementJump(string keyword) : Statement { public const string Break = "break"; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs index 5ecb17a9..5447dc76 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class ReturnStatement : Statement { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => Expression is not null ? [Expression] : []; public Expression? Expression { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs index 3f113ff4..fc0de4e9 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs +++ b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs @@ -1,9 +1,9 @@ namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -[AutoVisitable] +[AutoVisitable] public partial class WhileStatement : Statement { - protected override IReadOnlyList Children => + protected override IReadOnlyList Children => [Condition, Statement]; public Expression Condition { get; } diff --git a/src/HydraScript.Lib/IR/Ast/Scope.cs b/src/HydraScript.Lib/IR/Ast/Scope.cs new file mode 100644 index 00000000..bae7b036 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Scope.cs @@ -0,0 +1,12 @@ +namespace HydraScript.Lib.IR.Ast; + +public record Scope +{ + public Guid Id { get; } = Guid.NewGuid(); + public Scope? OpenScope { get; private set; } + + public void AddOpenScope(Scope scope) => + OpenScope = scope; + + public override string ToString() => Id.ToString(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs index 9d98e69f..9a8c3412 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs +++ b/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs @@ -1,21 +1,21 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Impl.Values; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.Ast.Visitors.Services; namespace HydraScript.Lib.IR.Ast.Visitors; -public class ExpressionInstructionProvider : VisitorBase, +public class ExpressionInstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -30,8 +30,15 @@ public class ExpressionInstructionProvider : VisitorBase, IVisitor { + private readonly IValueDtoConverter _valueDtoConverter; + + public ExpressionInstructionProvider(IValueDtoConverter valueDtoConverter) + { + _valueDtoConverter = valueDtoConverter; + } + public AddressedInstructions Visit(PrimaryExpression visitable) => - [new Simple(visitable.ToValue())]; + [new Simple(_valueDtoConverter.Convert(visitable.ToValueDto()))]; public AddressedInstructions Visit(ArrayLiteral visitable) { @@ -48,7 +55,10 @@ public AddressedInstructions Visit(ArrayLiteral visitable) var index = new Constant(i); if (expression is PrimaryExpression primary) - result.Add(new IndexAssignment(arrayName, index, primary.ToValue())); + result.Add(new IndexAssignment( + arrayName, + index, + _valueDtoConverter.Convert(primary.ToValueDto()))); else { result.AddRange(expression.Accept(This)); @@ -82,7 +92,10 @@ public AddressedInstructions Visit(Property visitable) var propertyId = new Constant(id); if (expression is PrimaryExpression primary) - return [new DotAssignment(objectId, propertyId, primary.ToValue())]; + return [new DotAssignment( + objectId, + propertyId, + _valueDtoConverter.Convert(primary.ToValueDto()))]; var instructions = expression.Accept(This); var last = new Name(instructions.OfType().Last().Left!); @@ -94,7 +107,7 @@ public AddressedInstructions Visit(Property visitable) public AddressedInstructions Visit(UnaryExpression visitable) { if (visitable.Expression is PrimaryExpression primary) - return [new Simple(visitable.Operator, primary.ToValue())]; + return [new Simple(visitable.Operator, _valueDtoConverter.Convert(primary.ToValueDto()))]; var result = visitable.Expression.Accept(This); var last = new Name(result.OfType().Last().Left!); @@ -106,13 +119,13 @@ public AddressedInstructions Visit(UnaryExpression visitable) public AddressedInstructions Visit(BinaryExpression visitable) { if (visitable is { Left: IdentifierReference arr, Right: PrimaryExpression primary, Operator: "::" }) - return [new RemoveFromArray(arr.Name, primary.ToValue())]; + return [new RemoveFromArray(arr.Name, index: _valueDtoConverter.Convert(primary.ToValueDto()))]; var result = new AddressedInstructions(); IValue left, right; if (visitable.Left is PrimaryExpression primaryLeft) - left = primaryLeft.ToValue(); + left = _valueDtoConverter.Convert(primaryLeft.ToValueDto()); else { result.AddRange(visitable.Left.Accept(This)); @@ -120,7 +133,7 @@ public AddressedInstructions Visit(BinaryExpression visitable) } if (visitable.Right is PrimaryExpression primaryRight) - right = primaryRight.ToValue(); + right = _valueDtoConverter.Convert(primaryRight.ToValueDto()); else { result.AddRange(visitable.Right.Accept(This)); @@ -135,7 +148,7 @@ public AddressedInstructions Visit(BinaryExpression visitable) public AddressedInstructions Visit(CastAsExpression visitable) { if (visitable.Expression is PrimaryExpression primary) - return [new AsString(primary.ToValue())]; + return [new AsString(_valueDtoConverter.Convert(primary.ToValueDto()))]; var result = visitable.Expression.Accept(This); var last = new Name(result.OfType().Last().Left!); @@ -153,7 +166,7 @@ public AddressedInstructions Visit(ConditionalExpression visitable) var result = new AddressedInstructions(); if (visitable.Test is PrimaryExpression primary) - result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); + result.Add(new IfNotGoto(test: _valueDtoConverter.Convert(primary.ToValueDto()), startBlockLabel)); else { result.AddRange(visitable.Test.Accept(This)); @@ -226,7 +239,7 @@ public AddressedInstructions Visit(IndexAccess visitable) IValue right; if (visitable.Index is PrimaryExpression primary) - right = primary.ToValue(); + right = _valueDtoConverter.Convert(primary.ToValueDto()); else { result.AddRange(visitable.Index.Accept(This)); @@ -247,13 +260,15 @@ public AddressedInstructions Visit(IndexAccess visitable) public AddressedInstructions Visit(CallExpression visitable) { + if (visitable.IsEmptyCall) + return []; var methodCall = !visitable.Empty(); if (visitable.Id.Name is "print" && !methodCall) { var param = visitable.Parameters[0]; if (param is PrimaryExpression prim) - return [new Print(prim.ToValue())]; + return [new Print(_valueDtoConverter.Convert(prim.ToValueDto()))]; var result = param.Accept(This); var last = new Name(result.OfType().Last().Left!); @@ -263,7 +278,7 @@ public AddressedInstructions Visit(CallExpression visitable) } else { - FunctionSymbol functionSymbol; + string functionId; AddressedInstructions result = []; if (methodCall) { @@ -272,43 +287,34 @@ public AddressedInstructions Visit(CallExpression visitable) memberInstructions.Remove(lastMemberInstruction); result.AddRange(memberInstructions); - var methodName = lastMemberInstruction.Property; - functionSymbol = visitable.SymbolTable - .FindSymbol(methodName)!; + functionId = lastMemberInstruction.Property; } else { - functionSymbol = visitable.SymbolTable - .FindSymbol(visitable.Id)!; + functionId = visitable.Id; } - if (functionSymbol.IsEmpty) - return []; - var functionInfo = new FunctionInfo(functionSymbol.Id); + var functionInfo = new FunctionInfo(functionId); if (methodCall) { var caller = result.Any() ? result.OfType().Last().Left! : visitable.Id; - result.Add(new PushParameter(functionSymbol.Parameters[0].Id, new Name(caller))); + result.Add(new PushParameter(new Name(caller))); } - foreach (var (expr, symbol) in visitable.Parameters - .Zip(functionSymbol.Parameters.ToArray()[(methodCall ? 1 : 0)..])) + foreach (var expr in visitable.Parameters) { if (expr is PrimaryExpression primary) - result.Add(new PushParameter(symbol.Id, primary.ToValue())); + result.Add(new PushParameter(_valueDtoConverter.Convert(primary.ToValueDto()))); else { result.AddRange(expr.Accept(This)); var id = result.OfType().Last().Left!; - result.Add(new PushParameter(symbol.Id, new Name(id))); + result.Add(new PushParameter(new Name(id))); } } - Type @void = "void"; - var hasReturnValue = !functionSymbol.Type.Equals(@void); result.Add(new CallFunction( functionInfo, - numberOfArguments: visitable.Parameters.Count + (methodCall ? 1 : 0), - hasReturnValue)); + visitable.HasReturnValue)); return result; } } diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs index 9f1f0334..a2199b14 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs +++ b/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs @@ -1,17 +1,18 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Impl.Values; using HydraScript.Lib.IR.Ast.Impl.Nodes; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.Ast.Visitors.Services; namespace HydraScript.Lib.IR.Ast.Visitors; -public class InstructionProvider : VisitorBase, +public class InstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -22,11 +23,13 @@ public class InstructionProvider : VisitorBase, IVisitor { - private readonly IVisitor _expressionVisitor; + private readonly IValueDtoConverter _valueDtoConverter; + private readonly IVisitor _expressionVisitor; - public InstructionProvider() + public InstructionProvider(IValueDtoConverter valueDtoConverter) { - _expressionVisitor = new ExpressionInstructionProvider(); + _valueDtoConverter = valueDtoConverter; + _expressionVisitor = new ExpressionInstructionProvider(_valueDtoConverter); } public AddressedInstructions Visit(ScriptBody visitable) @@ -94,7 +97,7 @@ public AddressedInstructions Visit(ReturnStatement visitable) case null: return [new Return()]; case PrimaryExpression primary: - return [new Return(primary.ToValue())]; + return [new Return(_valueDtoConverter.Convert(primary.ToValueDto()))]; } var result = visitable.Expression.Accept(_expressionVisitor); @@ -120,6 +123,9 @@ public AddressedInstructions Visit(FunctionDeclaration visitable) } }; + foreach (var (id, _) in visitable.Arguments) + result.Add(new PopParameter(id)); + result.AddRange(visitable.Statements.Accept(This)); if (!visitable.HasReturnStatement()) result.Add(new Return()); @@ -141,7 +147,7 @@ public AddressedInstructions Visit(WhileStatement visitable) }; if (visitable.Condition is PrimaryExpression primary) - result.Add(new IfNotGoto(primary.ToValue(), endBlockLabel)); + result.Add(new IfNotGoto(test: _valueDtoConverter.Convert(primary.ToValueDto()), endBlockLabel)); else { result.AddRange(visitable.Condition.Accept(_expressionVisitor)); @@ -183,7 +189,7 @@ public AddressedInstructions Visit(IfStatement visitable) var result = new AddressedInstructions(); if (visitable.Test is PrimaryExpression primary) - result.Add(new IfNotGoto(primary.ToValue(), startBlockLabel)); + result.Add(new IfNotGoto(test: _valueDtoConverter.Convert(primary.ToValueDto()), startBlockLabel)); else { result.AddRange(visitable.Test.Accept(_expressionVisitor)); diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs b/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs new file mode 100644 index 00000000..c9eebb21 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs @@ -0,0 +1,9 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.Ast.Visitors.Services; + +public interface IValueDtoConverter +{ + IValue Convert(ValueDto dto); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs b/src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs new file mode 100644 index 00000000..fa350339 --- /dev/null +++ b/src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs @@ -0,0 +1,18 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Lib.IR.Ast.Visitors.Services.Impl; + +public class ValueDtoConverter : IValueDtoConverter +{ + public IValue Convert(ValueDto dto) => + dto switch + { + { Type: ValueDtoType.Constant, Label: not null } => + new Constant(dto.Value, dto.Label), + { Type: ValueDtoType.Name, Name: not null } => + new Name(dto.Name), + _ => throw new ArgumentOutOfRangeException(nameof(dto)) + }; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs new file mode 100644 index 00000000..4b2db159 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs @@ -0,0 +1,7 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables; + +public interface ISymbol +{ + public string Id { get; } + public Type Type { get; } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs new file mode 100644 index 00000000..5e0a8a7f --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs @@ -0,0 +1,34 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables; + +public interface ISymbolTable +{ + /// + /// Добавление области видимости + /// + /// Доступная область видимости + public void AddOpenScope(ISymbolTable table); + + /// + /// Символы доступные в области видимости таблицы + /// + public IEnumerable GetAvailableSymbols(); + + /// + /// Добавление собственного символа в область видимости + /// + /// Собственный символ + public void AddSymbol(ISymbol symbol); + + /// + /// Поиск эффективного символа + /// + /// Идентификатор символа + public TSymbol? FindSymbol(string id) + where TSymbol : class, ISymbol; + + /// + /// Проверка наличия собственного символа + /// + /// Идентификатор символа + public bool ContainsSymbol(string id); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs new file mode 100644 index 00000000..af554a39 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs @@ -0,0 +1,32 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl; + +public class SymbolTable : ISymbolTable +{ + private readonly Dictionary _symbols = []; + private ISymbolTable? _openScope; + + /// + public void AddOpenScope(ISymbolTable table) => _openScope = table; + + /// + public IEnumerable GetAvailableSymbols() => + _symbols.Values.Concat(_openScope?.GetAvailableSymbols() ?? []); + + /// + public void AddSymbol(ISymbol symbol) => + _symbols[symbol.Id] = symbol; + + /// + public TSymbol? FindSymbol(string id) + where TSymbol : class, ISymbol + { + var hasInsideTheScope = _symbols.TryGetValue(id, out var symbol); + return !hasInsideTheScope + ? _openScope?.FindSymbol(id) + : symbol as TSymbol; + } + + /// + public bool ContainsSymbol(string id) => + _symbols.ContainsKey(id); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs similarity index 55% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs rename to src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs index c6af2c56..3a3475cf 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/FunctionSymbol.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs @@ -1,22 +1,22 @@ using System.Text; -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; public class FunctionSymbol( string id, - IEnumerable parameters, + IEnumerable parameters, Type type, - bool isEmpty) : Symbol + bool isEmpty) : Symbol(id, type) { - public override string Id { get; } = id; - + private Type _returnType = type; /// Тип возврата функции - public override Type Type => type; - public IReadOnlyList Parameters { get; } = new List(parameters); + public override Type Type => _returnType; + + public IReadOnlyList Parameters { get; } = new List(parameters); public bool IsEmpty { get; } = isEmpty; public void DefineReturnType(Type returnType) => - type = returnType; + _returnType = returnType; public override string ToString() => new StringBuilder($"function {Id}(") diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs new file mode 100644 index 00000000..d2bdce52 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs @@ -0,0 +1,11 @@ +using HydraScript.Lib.IR.CheckSemantics.Types; + +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; + +public class ObjectSymbol( + string id, + ObjectType objectType, + bool readOnly = false) : VariableSymbol(id, objectType, readOnly) +{ + public override ObjectType Type { get; } = objectType; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs new file mode 100644 index 00000000..ebf42557 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs @@ -0,0 +1,7 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; + +public abstract class Symbol(string id, Type type) : ISymbol +{ + public virtual string Id { get; } = id; + public virtual Type Type { get; } = type; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs new file mode 100644 index 00000000..0fbf9869 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs @@ -0,0 +1,15 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; + +public class TypeSymbol(Type type, string? id = null) : + Symbol(id ?? type.ToString(), type) +{ + public override bool Equals(object? obj) => + obj is TypeSymbol typeSymbol && + Id == typeSymbol.Id && Type.Equals(typeSymbol.Type); + + public override int GetHashCode() => + HashCode.Combine(Id, Type); + + public override string ToString() => + $"type {Id} = {Type}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs new file mode 100644 index 00000000..6af2e704 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs @@ -0,0 +1,12 @@ +namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; + +public class VariableSymbol( + string id, + Type type, + bool readOnly = false) : Symbol(id, type) +{ + public bool ReadOnly { get; } = readOnly; + + public override string ToString() => + $"{(ReadOnly ? "const " : "")}{Id}: {Type}"; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs deleted file mode 100644 index 86ea0d8d..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/SymbolTable.cs +++ /dev/null @@ -1,41 +0,0 @@ -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; - -namespace HydraScript.Lib.IR.CheckSemantics.Variables; - -public class SymbolTable -{ - private readonly Dictionary _symbols = new(); - - private SymbolTable? _openScope; - - public void AddOpenScope(SymbolTable table) - { - _openScope = table; - } - - /// - /// Символы доступные в области видимости таблицы - /// - public IEnumerable GetAvailableSymbols() => - _symbols.Values.Concat(_openScope?.GetAvailableSymbols() ?? []); - - public void AddSymbol(Symbol symbol) => - _symbols[symbol.Id] = symbol; - - /// - /// Поиск эффективного символа - /// - public TSymbol? FindSymbol(string id) where TSymbol : Symbol - { - var hasInsideTheScope = _symbols.TryGetValue(id, out var symbol); - return !hasInsideTheScope - ? _openScope?.FindSymbol(id) - : symbol as TSymbol; - } - - /// - /// Проверяет наличие собственного символа - /// - public bool ContainsSymbol(string id) => - _symbols.ContainsKey(id); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs deleted file mode 100644 index ad855412..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/ObjectSymbol.cs +++ /dev/null @@ -1,9 +0,0 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; - -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; - -public class ObjectSymbol(string id, ObjectType objectType, bool readOnly = false) - : VariableSymbol(id, objectType, readOnly) -{ - public override ObjectType Type { get; } = objectType; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs deleted file mode 100644 index bf392ca4..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/Symbol.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; - -public abstract class Symbol -{ - public abstract string Id { get; } - public abstract Type Type { get; } -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs deleted file mode 100644 index 3d7970a5..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/TypeSymbol.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; - -public class TypeSymbol(Type type, string? id = null) : Symbol -{ - public override string Id { get; } = id ?? type.ToString(); - public override Type Type { get; } = type; - - public override bool Equals(object? obj) - { - if (obj is TypeSymbol typeSymbol) - { - return Id == typeSymbol.Id && - Type.Equals(typeSymbol.Type); - } - - return false; - } - - public override int GetHashCode() => - HashCode.Combine(Id, Type); - - public override string ToString() => - $"type {Id} = {Type}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs b/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs deleted file mode 100644 index ced931a3..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Symbols/VariableSymbol.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; - -public class VariableSymbol(string id, Type type, bool readOnly = false) : Symbol -{ - public override string Id { get; } = id; - public override Type Type { get; } = type; - public bool ReadOnly { get; } = readOnly; - - public override string ToString() => $"{(ReadOnly ? "const " : "")}{Id}: {Type}"; -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs index 5bf69f53..59c941f8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs @@ -5,27 +5,32 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; using HydraScript.Lib.IR.CheckSemantics.Exceptions; using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class DeclarationVisitor : VisitorNoReturnBase, +public class DeclarationVisitor : VisitorNoReturnBase, IVisitor, IVisitor { private readonly IFunctionWithUndefinedReturnStorage _functionStorage; private readonly IMethodStorage _methodStorage; + private readonly ISymbolTableStorage _symbolTables; + private readonly IVisitor _typeBuilder; public DeclarationVisitor( IFunctionWithUndefinedReturnStorage functionStorage, - IMethodStorage methodStorage) + IMethodStorage methodStorage, + ISymbolTableStorage symbolTables) { _functionStorage = functionStorage; _methodStorage = methodStorage; + _symbolTables = symbolTables; + _typeBuilder = new TypeBuilder(_symbolTables); } - public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(IAbstractSyntaxTreeNode visitable) { for (var i = 0; i < visitable.Count; i++) visitable[i].Accept(This); @@ -38,11 +43,11 @@ public VisitUnit Visit(LexicalDeclaration visitable) for (var i = 0; i < visitable.Assignments.Count; i++) { var assignment = visitable.Assignments[i]; - if (visitable.SymbolTable.ContainsSymbol(assignment.Destination.Id)) + if (_symbolTables[visitable.Scope].ContainsSymbol(assignment.Destination.Id)) throw new DeclarationAlreadyExists(assignment.Destination.Id); - var destinationType = assignment.DestinationType?.BuildType( - assignment.SymbolTable) ?? "undefined"; + var destinationType = assignment.DestinationType?.Accept( + _typeBuilder) ?? "undefined"; if (destinationType == "undefined" && assignment.Source is ImplicitLiteral or ArrayLiteral { Expressions.Count: 0 }) @@ -50,7 +55,7 @@ public VisitUnit Visit(LexicalDeclaration visitable) ? new ConstWithoutInitializer(assignment.Destination.Id) : new CannotDefineType(assignment.Destination.Id.Segment); - visitable.SymbolTable.AddSymbol( + _symbolTables[visitable.Scope].AddSymbol( new VariableSymbol( assignment.Destination.Id, destinationType)); @@ -61,23 +66,23 @@ public VisitUnit Visit(LexicalDeclaration visitable) public VisitUnit Visit(FunctionDeclaration visitable) { - if (visitable.Parent.SymbolTable.ContainsSymbol(visitable.Name)) + if (_symbolTables[visitable.Parent.Scope].ContainsSymbol(visitable.Name)) throw new DeclarationAlreadyExists(visitable.Name); var parameters = visitable.Arguments.Select(x => { var arg = new VariableSymbol( id: x.Key, - x.TypeValue.BuildType(visitable.Parent.SymbolTable)); - visitable.SymbolTable.AddSymbol(arg); + x.TypeValue.Accept(_typeBuilder)); + _symbolTables[visitable.Scope].AddSymbol(arg); return arg; }).ToList(); var functionSymbol = new FunctionSymbol( visitable.Name, parameters, - visitable.ReturnTypeValue.BuildType(visitable.Parent.SymbolTable), - isEmpty: !visitable.Statements.Any()); + visitable.ReturnTypeValue.Accept(_typeBuilder), + visitable.IsEmpty); if (parameters is [{ Type: ObjectType objectType }, ..] && visitable.Arguments is [{ TypeValue: TypeIdentValue }, ..]) { @@ -93,7 +98,7 @@ public VisitUnit Visit(FunctionDeclaration visitable) functionSymbol.DefineReturnType("void"); } - visitable.Parent.SymbolTable.AddSymbol(functionSymbol); + _symbolTables[visitable.Parent.Scope].AddSymbol(functionSymbol); return visitable.Statements.Accept(This); } } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs index ed6acc60..744915df 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs @@ -1,5 +1,6 @@ using HydraScript.Lib.IR.Ast; using HydraScript.Lib.IR.Ast.Impl.Nodes; +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; @@ -8,12 +9,13 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; using HydraScript.Lib.IR.CheckSemantics.Exceptions; using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class SemanticChecker : VisitorBase, +public class SemanticChecker : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -41,15 +43,20 @@ public class SemanticChecker : VisitorBase, private readonly IDefaultValueForTypeCalculator _calculator; private readonly IFunctionWithUndefinedReturnStorage _functionStorage; private readonly IMethodStorage _methodStorage; + private readonly ISymbolTableStorage _symbolTables; + private readonly IVisitor _typeBuilder; public SemanticChecker( IDefaultValueForTypeCalculator calculator, IFunctionWithUndefinedReturnStorage functionStorage, - IMethodStorage methodStorage) + IMethodStorage methodStorage, + ISymbolTableStorage symbolTables) { _calculator = calculator; _functionStorage = functionStorage; _methodStorage = methodStorage; + _symbolTables = symbolTables; + _typeBuilder = new TypeBuilder(_symbolTables); } public override Type DefaultVisit => "undefined"; @@ -126,16 +133,16 @@ public Type Visit(ExpressionStatement visitable) => public Type Visit(IdentifierReference visitable) { - var symbol = visitable.SymbolTable.FindSymbol(visitable.Name); + var symbol = _symbolTables[visitable.Scope].FindSymbol(visitable.Name); return symbol?.Type ?? throw new UnknownIdentifierReference(visitable); } public Type Visit(Literal visitable) => - visitable.Type.BuildType(visitable.Parent.SymbolTable); + visitable.Type.Accept(_typeBuilder); public Type Visit(ImplicitLiteral visitable) { - var type = visitable.TypeValue.BuildType(visitable.Parent.SymbolTable); + var type = visitable.Type.Accept(_typeBuilder); visitable.ComputedDefaultValue = _calculator.GetDefaultValueForType(type); return type; } @@ -157,7 +164,7 @@ public Type Visit(ObjectLiteral visitable) var properties = visitable.Properties.Select(prop => { var propType = prop.Expression.Accept(This); - visitable.SymbolTable.AddSymbol(propType switch + _symbolTables[visitable.Scope].AddSymbol(propType switch { ObjectType objectType => new ObjectSymbol(prop.Id, objectType), _ => new VariableSymbol(prop.Id, propType) @@ -253,7 +260,7 @@ public Type Visit(LexicalDeclaration visitable) for (var i = 0; i < visitable.Assignments.Count; i++) { var assignment = visitable.Assignments[i]; - var registeredSymbol = visitable.SymbolTable.FindSymbol( + var registeredSymbol = _symbolTables[visitable.Scope].FindSymbol( assignment.Destination.Id); var sourceType = assignment.Source.Accept(This); if (sourceType.Equals(undefined)) @@ -272,7 +279,7 @@ public Type Visit(LexicalDeclaration visitable) ObjectType objectType => new ObjectSymbol(registeredSymbol.Id, objectType, visitable.ReadOnly), _ => new VariableSymbol(registeredSymbol.Id, actualType, visitable.ReadOnly) }; - visitable.SymbolTable.AddSymbol(actualSymbol); + _symbolTables[visitable.Scope].AddSymbol(actualSymbol); } return undefined; @@ -296,7 +303,7 @@ public Type Visit(AssignmentExpression visitable) } var symbol = - visitable.SymbolTable.FindSymbol( + _symbolTables[visitable.Scope].FindSymbol( visitable.Destination.Id) ?? throw new UnknownIdentifierReference(visitable.Destination.Id); @@ -365,7 +372,7 @@ public Type Visit(CastAsExpression visitable) if (exprType.Equals(undefined)) throw new CannotDefineType(visitable.Expression.Segment); - return visitable.Cast.BuildType(visitable.SymbolTable) == "string" + return visitable.Cast.Accept(_typeBuilder) == "string" ? "string" : throw new NotSupportedException("Other types but 'string' have not been supported for casting yet"); } @@ -384,13 +391,14 @@ public Type Visit(CallExpression visitable) else { var symbol = - visitable.SymbolTable.FindSymbol(visitable.Id) + _symbolTables[visitable.Scope].FindSymbol(visitable.Id) ?? throw new UnknownIdentifierReference(visitable.Id); functionSymbol = symbol as FunctionSymbol ?? throw new SymbolIsNotCallable(symbol.Id, visitable.Id.Segment); } + visitable.IsEmptyCall = functionSymbol.IsEmpty; var functionReturnType = functionSymbol.Type; if (functionSymbol.Parameters.Count != visitable.Parameters.Count + (methodCall ? 1 : 0)) @@ -415,12 +423,15 @@ symbol as FunctionSymbol functionReturnType = declaration.Accept(This); } + Type @void = "void"; + if (functionReturnType.Equals(@void)) + visitable.HasReturnValue = true; return functionReturnType; } public Type Visit(FunctionDeclaration visitable) { - var symbol = visitable.SymbolTable.FindSymbol(visitable.Name)!; + var symbol = _symbolTables[visitable.Scope].FindSymbol(visitable.Name)!; _functionStorage.RemoveIfPresent(symbol); visitable.Statements.Accept(This); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs index 9f75a9c5..739b26f3 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs @@ -1,5 +1,5 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs index 5312c5f2..1af6123b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs @@ -3,4 +3,6 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; public interface IJavaScriptTypesProvider { IEnumerable GetDefaultTypes(); + + bool Contains(Type type); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs index d9dfff56..6f5a9de1 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs @@ -1,5 +1,5 @@ using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs index 4da013d6..984c2593 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs @@ -4,5 +4,5 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; public interface IStandardLibraryProvider { - SymbolTable GetStandardLibrary(); + ISymbolTable GetStandardLibrary(); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs deleted file mode 100644 index cc06be62..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableInitializerService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface ISymbolTableInitializerService -{ - void InitThroughParent(AbstractSyntaxTreeNode node); - - void InitWithNewScope(AbstractSyntaxTreeNode node); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs new file mode 100644 index 00000000..900b5b9b --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs @@ -0,0 +1,13 @@ +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.CheckSemantics.Variables; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +public interface ISymbolTableStorage +{ + public ISymbolTable this[Scope scope] { get; } + + public void Init(Scope scope, ISymbolTable symbolTable); + + public void InitWithOpenScope(Scope scope); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs index 0d71ebbd..35ef3a80 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs @@ -2,7 +2,7 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator +public class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator { private readonly Type _boolean = "boolean"; private readonly Type _number = "number"; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs index 3f4bab11..720a2f1c 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs @@ -1,9 +1,9 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage +public class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage { private readonly Dictionary _declarations = new(); private readonly Dictionary _keysWithOrder = new(); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs index 2af4f36f..1b7e0a82 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs @@ -2,15 +2,19 @@ namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class JavaScriptTypesProvider : IJavaScriptTypesProvider +public class JavaScriptTypesProvider : IJavaScriptTypesProvider { - public IEnumerable GetDefaultTypes() - { - yield return "number"; - yield return "boolean"; - yield return "string"; - yield return new NullType(); - yield return "undefined"; - yield return "void"; - } + private readonly HashSet _types = + [ + "number", + "boolean", + "string", + new NullType(), + "undefined", + "void" + ]; + + public IEnumerable GetDefaultTypes() => _types; + + public bool Contains(Type type) => _types.Contains(type); } \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs index bb98d574..2c04dc6f 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs @@ -1,9 +1,9 @@ using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class MethodStorage : IMethodStorage +public class MethodStorage : IMethodStorage { private readonly Dictionary> _bindings = new(); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs index 35d9494f..2dee053b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs @@ -1,33 +1,28 @@ using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class StandardLibraryProvider : IStandardLibraryProvider +public class StandardLibraryProvider : IStandardLibraryProvider { private readonly IJavaScriptTypesProvider _provider; public StandardLibraryProvider(IJavaScriptTypesProvider provider) => _provider = provider; - public SymbolTable GetStandardLibrary() + public ISymbolTable GetStandardLibrary() { var library = new SymbolTable(); foreach (var type in _provider.GetDefaultTypes()) - { library.AddSymbol(new TypeSymbol(type)); - } var print = new FunctionSymbol( "print", - new List - { - new VariableSymbol("str", "string") - }, + [new VariableSymbol("str", "string")], "void", - isEmpty: false - ); + isEmpty: false); library.AddSymbol(print); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs deleted file mode 100644 index 8564f59a..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableInitializerService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; - -internal class SymbolTableInitializerService : ISymbolTableInitializerService -{ - public void InitThroughParent(AbstractSyntaxTreeNode node) => - node.SymbolTable = node.Parent.SymbolTable; - - public void InitWithNewScope(AbstractSyntaxTreeNode node) - { - node.SymbolTable = new(); - node.SymbolTable.AddOpenScope(node.Parent.SymbolTable); - } -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs new file mode 100644 index 00000000..b0409cd2 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs @@ -0,0 +1,24 @@ +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; + +public class SymbolTableStorage : ISymbolTableStorage +{ + private readonly Dictionary _symbolTables = []; + public ISymbolTable this[Scope scope] => _symbolTables[scope.Id]; + + public void Init(Scope scope, ISymbolTable symbolTable) => + _symbolTables.TryAdd(scope.Id, symbolTable); + + public void InitWithOpenScope(Scope scope) + { + ArgumentNullException.ThrowIfNull(scope.OpenScope); + if (_symbolTables.ContainsKey(scope.Id)) + return; + var symbolTable = new SymbolTable(); + symbolTable.AddOpenScope(_symbolTables[scope.OpenScope.Id]); + _symbolTables[scope.Id] = symbolTable; + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs index d7c5443d..5241764a 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs @@ -1,15 +1,23 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -internal class TypeDeclarationsResolver : ITypeDeclarationsResolver +public class TypeDeclarationsResolver : ITypeDeclarationsResolver { private readonly Queue _declarationsToResolve = new(); private readonly IJavaScriptTypesProvider _provider; + private readonly ISymbolTableStorage _symbolTables; + private readonly IVisitor _typeBuilder; - public TypeDeclarationsResolver(IJavaScriptTypesProvider provider) => + public TypeDeclarationsResolver( + IJavaScriptTypesProvider provider, + ISymbolTableStorage symbolTables) + { _provider = provider; + _symbolTables = symbolTables; + _typeBuilder = new TypeBuilder(_symbolTables); + } public void Store(TypeDeclaration declaration) => _declarationsToResolve.Enqueue(declaration); @@ -22,9 +30,9 @@ public void Resolve() foreach (var declarationToResolve in _declarationsToResolve) { - declarationToResolve.SymbolTable.AddSymbol( + _symbolTables[declarationToResolve.Scope].AddSymbol( new TypeSymbol( - declarationToResolve.BuildType(), + declarationToResolve.TypeValue.Accept(_typeBuilder), declarationToResolve.TypeId)); } @@ -32,10 +40,10 @@ public void Resolve() { var declarationToResolve = _declarationsToResolve.Dequeue(); - var typeSymbol = declarationToResolve.SymbolTable + var typeSymbol = _symbolTables[declarationToResolve.Scope] .FindSymbol(declarationToResolve.TypeId)!; - var resolvingCandidates = declarationToResolve.SymbolTable + var resolvingCandidates = _symbolTables[declarationToResolve.Scope] .GetAvailableSymbols() .OfType() .Except(defaults); diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs index f89deae1..108f9d3c 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs @@ -2,29 +2,31 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class SymbolTableInitializer : VisitorNoReturnBase, +public class SymbolTableInitializer : VisitorNoReturnBase, IVisitor, IVisitor, IVisitor { - private readonly ISymbolTableInitializerService _initializerService; private readonly IStandardLibraryProvider _provider; + private readonly ISymbolTableStorage _symbolTables; public SymbolTableInitializer( - ISymbolTableInitializerService initializerService, - IStandardLibraryProvider provider) + IStandardLibraryProvider provider, + ISymbolTableStorage symbolTables) { - _initializerService = initializerService; _provider = provider; + _symbolTables = symbolTables; } - public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(IAbstractSyntaxTreeNode visitable) { - _initializerService.InitThroughParent(visitable); + visitable.InitScope(); + _symbolTables.Init(visitable.Scope, new SymbolTable()); for (var i = 0; i < visitable.Count; i++) visitable[i].Accept(This); @@ -33,7 +35,9 @@ public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) public VisitUnit Visit(ScriptBody visitable) { - visitable.SymbolTable = _provider.GetStandardLibrary(); + visitable.InitScope(new Scope()); + var symbolTable = _provider.GetStandardLibrary(); + _symbolTables.Init(visitable.Scope, symbolTable); for (var i = 0; i < visitable.Count; i++) visitable[i].Accept(This); return default; @@ -41,14 +45,16 @@ public VisitUnit Visit(ScriptBody visitable) public VisitUnit Visit(FunctionDeclaration visitable) { - _initializerService.InitWithNewScope(visitable); + visitable.InitScope(scope: new Scope()); + _symbolTables.InitWithOpenScope(visitable.Scope); visitable.Statements.Accept(This); return default; } public VisitUnit Visit(BlockStatement visitable) { - _initializerService.InitWithNewScope(visitable); + visitable.InitScope(scope: new Scope()); + _symbolTables.InitWithOpenScope(visitable.Scope); for (var i = 0; i < visitable.Count; i++) visitable[i].Accept(This); return default; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs new file mode 100644 index 00000000..6f93d351 --- /dev/null +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs @@ -0,0 +1,47 @@ +using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; + +namespace HydraScript.Lib.IR.CheckSemantics.Visitors; + +public class TypeBuilder : VisitorBase, + IVisitor, + IVisitor, + IVisitor, + IVisitor +{ + private readonly ISymbolTableStorage _symbolTables; + + public TypeBuilder(ISymbolTableStorage symbolTables) + { + _symbolTables = symbolTables; + } + + public Type Visit(TypeIdentValue visitable) => + _symbolTables[visitable.Scope].FindSymbol(visitable.TypeId)?.Type ?? + throw new UnknownIdentifierReference(visitable.TypeId); + + public ArrayType Visit(ArrayTypeValue visitable) + { + visitable.TypeValue.Scope = visitable.Scope; + return new ArrayType(visitable.TypeValue.Accept(This)); + } + + public NullableType Visit(NullableTypeValue visitable) + { + visitable.TypeValue.Scope = visitable.Scope; + return new NullableType(visitable.TypeValue.Accept(This)); + } + + public ObjectType Visit(ObjectTypeValue visitable) => + new(visitable.Properties + .Select(x => + { + x.TypeValue.Scope = visitable.Scope; + return new PropertyType( + Id: x.Key, + x.TypeValue.Accept(This)); + })); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs index a93618e1..d5b0c2a0 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs +++ b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs @@ -2,24 +2,27 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes; using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; namespace HydraScript.Lib.IR.CheckSemantics.Visitors; -public class TypeSystemLoader : VisitorNoReturnBase, +public class TypeSystemLoader : VisitorNoReturnBase, IVisitor, IVisitor { private readonly ITypeDeclarationsResolver _resolver; - private readonly ISet _defaultTypes; + private readonly IJavaScriptTypesProvider _provider; + private readonly ISymbolTableStorage _symbolTables; public TypeSystemLoader( ITypeDeclarationsResolver resolver, - IJavaScriptTypesProvider provider) + IJavaScriptTypesProvider provider, + ISymbolTableStorage symbolTables) { _resolver = resolver; - _defaultTypes = provider.GetDefaultTypes().ToHashSet(); + _provider = provider; + _symbolTables = symbolTables; } public VisitUnit Visit(ScriptBody visitable) @@ -30,7 +33,7 @@ public VisitUnit Visit(ScriptBody visitable) return default; } - public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) + public override VisitUnit Visit(IAbstractSyntaxTreeNode visitable) { for (var i = 0; i < visitable.Count; i++) visitable[i].Accept(This); @@ -40,11 +43,12 @@ public override VisitUnit Visit(AbstractSyntaxTreeNode visitable) public VisitUnit Visit(TypeDeclaration visitable) { - if (visitable.SymbolTable.ContainsSymbol(visitable.TypeId) || - _defaultTypes.Contains(visitable.TypeId.Name)) + var symbolTable = _symbolTables[visitable.Scope]; + if (symbolTable.ContainsSymbol(visitable.TypeId) || + _provider.Contains(visitable.TypeId.Name)) throw new DeclarationAlreadyExists(visitable.TypeId); - visitable.SymbolTable.AddSymbol( + symbolTable.AddSymbol( new TypeSymbol( visitable.TypeId.Name, visitable.TypeId)); diff --git a/src/HydraScript/Program.cs b/src/HydraScript/Program.cs index 749de194..685fb75e 100644 --- a/src/HydraScript/Program.cs +++ b/src/HydraScript/Program.cs @@ -3,6 +3,8 @@ using CommandLine; using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Services.CodeGen; +using HydraScript.Services.CodeGen.Impl; using HydraScript.Services.Executor; using HydraScript.Services.Executor.Impl; using HydraScript.Services.Parsing; @@ -47,6 +49,7 @@ private static void ConfigureServices(CommandLineSettings settings) ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); + ServiceCollection.AddSingleton(); ServiceCollection.AddSingleton(); diff --git a/src/HydraScript/Services/CodeGen/ICodeGenService.cs b/src/HydraScript/Services/CodeGen/ICodeGenService.cs new file mode 100644 index 00000000..1086f1f2 --- /dev/null +++ b/src/HydraScript/Services/CodeGen/ICodeGenService.cs @@ -0,0 +1,9 @@ +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast; + +namespace HydraScript.Services.CodeGen; + +public interface ICodeGenService +{ + AddressedInstructions GetInstructions(IAbstractSyntaxTree ast); +} \ No newline at end of file diff --git a/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs b/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs new file mode 100644 index 00000000..d36fa832 --- /dev/null +++ b/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs @@ -0,0 +1,75 @@ +using System.IO.Abstractions; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.IR.Ast; +using HydraScript.Lib.IR.Ast.Visitors; +using HydraScript.Lib.IR.Ast.Visitors.Services.Impl; +using HydraScript.Lib.IR.CheckSemantics.Visitors; +using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +using Microsoft.Extensions.Options; +using Visitor.NET; +using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; + +namespace HydraScript.Services.CodeGen.Impl; + +internal class CodeGenService : ICodeGenService +{ + private readonly IVisitor _symbolTableInitializer; + private readonly IVisitor _typeSystemLoader; + private readonly IVisitor _declarationVisitor; + + private readonly IVisitor _semanticChecker; + private readonly IVisitor _instructionProvider; + + private readonly IFileSystem _fileSystem; + private readonly CommandLineSettings _settings; + + public CodeGenService(IFileSystem fileSystem, IOptions options) + { + _fileSystem = fileSystem; + _settings = options.Value; + + var functionStorage = new FunctionWithUndefinedReturnStorage(); + var methodStorage = new MethodStorage(); + var symbolTables = new SymbolTableStorage(); + + _symbolTableInitializer = new SymbolTableInitializer( + new StandardLibraryProvider( + new JavaScriptTypesProvider()), + symbolTables); + _typeSystemLoader = new TypeSystemLoader( + new TypeDeclarationsResolver( + new JavaScriptTypesProvider(), + symbolTables), + new JavaScriptTypesProvider(), + symbolTables); + _declarationVisitor = new DeclarationVisitor(functionStorage, methodStorage, symbolTables); + + _semanticChecker = new SemanticChecker( + new DefaultValueForTypeCalculator(), + functionStorage, + methodStorage, + symbolTables); + _instructionProvider = new InstructionProvider(new ValueDtoConverter()); + } + + public AddressedInstructions GetInstructions(IAbstractSyntaxTree ast) + { + var root = ast.Root; + root.Accept(_symbolTableInitializer); + root.Accept(_typeSystemLoader); + root.Accept(_declarationVisitor); + + root.Accept(_semanticChecker); + var instructions = root.Accept(_instructionProvider); + + if (_settings.Dump) + { + var fileName = _settings.InputFilePath.Split(".js")[0]; + _fileSystem.File.WriteAllLines( + $"{fileName}.tac", + instructions.Select(i => i.ToString()!)); + } + + return instructions; + } +} \ No newline at end of file diff --git a/src/HydraScript/Services/Executor/Impl/Executor.cs b/src/HydraScript/Services/Executor/Impl/Executor.cs index cda12c8f..233f6fba 100644 --- a/src/HydraScript/Services/Executor/Impl/Executor.cs +++ b/src/HydraScript/Services/Executor/Impl/Executor.cs @@ -1,8 +1,10 @@ -using HydraScript.Services.Parsing; using HydraScript.Lib.BackEnd; +using HydraScript.Services.Parsing; +using HydraScript.Lib.BackEnd.Impl; using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.TopDownParse; using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Services.CodeGen; using HydraScript.Services.SourceCode; namespace HydraScript.Services.Executor.Impl; @@ -11,13 +13,16 @@ public class Executor : IExecutor { private readonly IParsingService _parsingService; private readonly ISourceCodeProvider _sourceCodeProvider; + private readonly ICodeGenService _codeGenService; public Executor( IParsingService parsingService, - ISourceCodeProvider sourceCodeProvider) + ISourceCodeProvider sourceCodeProvider, + ICodeGenService codeGenService) { _parsingService = parsingService; _sourceCodeProvider = sourceCodeProvider; + _codeGenService = codeGenService; } public void Execute() @@ -26,9 +31,9 @@ public void Execute() { var text = _sourceCodeProvider.GetText(); var ast = _parsingService.Parse(text); - var instructions = ast.GetInstructions(); + var instructions = _codeGenService.GetInstructions(ast); - var vm = new VirtualMachine(); + IVirtualMachine vm = new VirtualMachine(Console.Out); vm.Run(instructions); } catch (Exception ex) diff --git a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs deleted file mode 100644 index 6db8a936..00000000 --- a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingAbstractSyntaxTree.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Services.Providers.ParserProvider.Impl; - -public class LoggingAbstractSyntaxTree : IAbstractSyntaxTree -{ - private readonly IAbstractSyntaxTree _ast; - private readonly string _fileName; - private readonly IFileSystem _fileSystem; - - public LoggingAbstractSyntaxTree(IAbstractSyntaxTree ast, string fileName, IFileSystem fileSystem) - { - _ast = ast; - _fileName = fileName; - _fileSystem = fileSystem; - } - - public AddressedInstructions GetInstructions() - { - var instructions = _ast.GetInstructions(); - _fileSystem.File.WriteAllLines( - $"{_fileName}.tac", - instructions.Select(i => i.ToString()) - ); - return instructions; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs index 93a92d85..148cd68a 100644 --- a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs +++ b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs @@ -7,13 +7,11 @@ namespace HydraScript.Services.Providers.ParserProvider.Impl; public class LoggingParser : IParser { private readonly IParser _parser; - private readonly string _fileName; private readonly IFileSystem _fileSystem; - public LoggingParser(IParser parser, string fileName, IFileSystem fileSystem) + public LoggingParser(IParser parser, IFileSystem fileSystem) { _parser = parser; - _fileName = fileName; _fileSystem = fileSystem; } @@ -22,6 +20,6 @@ public IAbstractSyntaxTree TopDownParse(string text) var ast = _parser.TopDownParse(text); var astDot = ast.ToString(); _fileSystem.File.WriteAllText("ast.dot", astDot); - return new LoggingAbstractSyntaxTree(ast, _fileName, _fileSystem); + return ast; } } \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs index 8516fde8..20cda958 100644 --- a/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs +++ b/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs @@ -26,9 +26,8 @@ public IParser CreateParser() { var lexer = _lexerProvider.CreateLexer(); var parser = new Parser(lexer); - var inputFileName = _settings.InputFilePath.Split(".js")[0]; return _settings.Dump - ? new LoggingParser(parser, inputFileName, _fileSystem) + ? new LoggingParser(parser, _fileSystem) : parser; } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Helpers/ListExtensions.cs b/tests/HydraScript.Tests/Helpers/ListExtensions.cs deleted file mode 100644 index 76d0f164..00000000 --- a/tests/HydraScript.Tests/Helpers/ListExtensions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Instructions; - -namespace HydraScript.Tests.Helpers; - -public static class ListExtensions -{ - public static AddressedInstructions ToAddressedInstructions(this List instructions) - { - var result = new AddressedInstructions(); - instructions.ForEach(x => result.Add(x)); - return result; - } -} \ No newline at end of file diff --git a/tests/HydraScript.Tests/Helpers/MockExtensions.cs b/tests/HydraScript.Tests/Helpers/MockExtensions.cs index b854cbeb..8037376a 100644 --- a/tests/HydraScript.Tests/Helpers/MockExtensions.cs +++ b/tests/HydraScript.Tests/Helpers/MockExtensions.cs @@ -1,6 +1,6 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; using Moq; namespace HydraScript.Tests.Helpers; @@ -9,18 +9,16 @@ public static class MockExtensions { public static Mock Trackable(this Mock halt) { - halt.Setup(x => x.Execute(It.IsAny())) + halt.Setup(x => x.Execute(It.IsAny())) .Returns(new HashAddress(seed: 0)).Verifiable(); - halt.Setup(x => x.End()).Returns(true); + halt.Setup(x => x.End).Returns(true); return halt; } - public static Mock ToInstructionMock(this int number) + public static Mock ToInstructionMock(this int number) { - var result = new Mock(MockBehavior.Default) - { - CallBase = true - }; + var result = new Mock(); + result.SetupAllProperties(); result.Setup(x => x.GetHashCode()) .Returns(number); diff --git a/tests/HydraScript.Tests/TestData/InstructionsData.cs b/tests/HydraScript.Tests/TestData/InstructionsData.cs index 506c1276..5f6311f1 100644 --- a/tests/HydraScript.Tests/TestData/InstructionsData.cs +++ b/tests/HydraScript.Tests/TestData/InstructionsData.cs @@ -1,12 +1,12 @@ using System.Collections; using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Impl.Values; namespace HydraScript.Tests.TestData; @@ -32,16 +32,16 @@ public IEnumerator GetEnumerator() }; yield return new object[] { - new CallFunction(new FunctionInfo("func"), 2, false), - "Call func, 2" + new CallFunction(new FunctionInfo("func"), false), + "Call func" }; yield return new object[] { - new CallFunction(new FunctionInfo("func"), 2, true) + new CallFunction(new FunctionInfo("func"), true) { Left = "ret" }, - "ret = Call func, 2" + "ret = Call func" }; yield return new object[] { @@ -93,8 +93,13 @@ public IEnumerator GetEnumerator() }; yield return new object[] { - new PushParameter("param", new Name("value")), - "PushParameter param = value" + new PushParameter(new Name("value")), + "PushParameter value" + }; + yield return new object[] + { + new PopParameter("param"), + "PopParameter param" }; yield return new object[] { diff --git a/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs index dd1e719f..13a7a102 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs @@ -1,8 +1,8 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Impl.Values; using HydraScript.Tests.Helpers; using Xunit; @@ -13,15 +13,15 @@ public class AddressedInstructionsTests [Fact] public void EnumerationPreservedAfterRemovalTest() { - var instructions = new List - { + AddressedInstructions instructions = + [ new AsString(new Constant(2)) { Left = "s" }, new Print(new Name("s")), new Halt() - }.ToAddressedInstructions(); + ]; instructions.Remove(instructions[instructions.Start.Next]); @@ -31,11 +31,11 @@ public void EnumerationPreservedAfterRemovalTest() [Fact] public void RemovalOfLastDoesNotThrowTest() { - var instructions = new List - { + AddressedInstructions instructions = + [ new AsString(new Constant(2)), new Halt() - }.ToAddressedInstructions(); + ]; Assert.Null(Record.Exception(() => instructions.Remove(instructions.Last()))); Assert.Null(instructions.Start.Next); @@ -69,18 +69,18 @@ public void ReplacementPreservesOrderTest() [Fact] public void GetEnumeratorTests() { - AddressedInstructions collection = new(); + AddressedInstructions collection = []; collection.Add(1.ToInstructionMock().Object); - - var collectionToAdd = new AddressedInstructions - { + + AddressedInstructions collectionToAdd = + [ 2.ToInstructionMock().Object, 3.ToInstructionMock().Object, 4.ToInstructionMock().Object - }; - + ]; + collection.AddRange(collectionToAdd); - + collection.Add(5.ToInstructionMock().Object); Assert.Collection( diff --git a/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs index 57469fcc..9a4d2977 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs @@ -1,5 +1,5 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Impl.Addresses; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; @@ -11,9 +11,8 @@ public void ToStringCorrect() { var call = new Call( new Label("9"), - new FunctionInfo("func"), - [("arg", 1)]); - const string expected = "9:\n\t => Start_func:\n\t: func(arg: 1)"; + new FunctionInfo("func")); + const string expected = "9:\n\t: => Start_func:\n\t: func"; Assert.Equal(expected, call.ToString()); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs index 57691c72..10f0a6f2 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.BackEnd.Addresses; +using HydraScript.Lib.BackEnd.Impl.Addresses; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs index 35979ae0..28804531 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs @@ -1,7 +1,8 @@ -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithJump; +using HydraScript.Lib.BackEnd; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; using HydraScript.Tests.TestData; +using Moq; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; @@ -10,7 +11,7 @@ public class InstructionsTests { [Theory] [ClassData(typeof(InstructionsData))] - public void ToStringCorrectTest(Instruction instruction, string expected) => + public void ToStringCorrectTest(IExecutableInstruction instruction, string expected) => Assert.Equal(expected, instruction.ToString()); [Fact] @@ -18,6 +19,6 @@ public void GotoJumpChangedTest() { var @goto = new Goto(new Label("1")); @goto.SetJump(new Label("5")); - Assert.Equal(new Label("5"), @goto.Execute(vm: new())); + Assert.Equal(new Label("5"), @goto.Execute(Mock.Of())); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs index 866fc92b..6397dcf6 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl.Values; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs index 648b31e1..8e900e97 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs @@ -1,11 +1,12 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Addresses; -using HydraScript.Lib.BackEnd.Instructions; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Values; +using HydraScript.Lib.BackEnd.Impl; +using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Lib.BackEnd.Impl.Values; using HydraScript.Tests.Helpers; using Moq; using Xunit; @@ -14,13 +15,13 @@ namespace HydraScript.Tests.Unit.BackEnd; public class VirtualMachineTests { - private readonly VirtualMachine _vm; + private readonly IVirtualMachine _vm; public VirtualMachineTests() { - _vm = new(new(), new(), new(), TextWriter.Null); + _vm = new VirtualMachine(TextWriter.Null); } - + [Fact] public void CorrectPrintToOutTest() { @@ -28,13 +29,18 @@ public void CorrectPrintToOutTest() writer.Setup(x => x.WriteLine(It.IsAny())) .Verifiable(); - var vm = new VirtualMachine(new(), new Stack(new[] { new Frame(new HashAddress(0)) }), new(), writer.Object); + var exParams = new Mock(); + exParams.Setup(x => x.CallStack).Returns(new Stack()); + exParams.Setup(x => x.Frames).Returns(new Stack(new[] { new Frame(new HashAddress(0)) })); + exParams.Setup(x => x.Arguments).Returns(new Queue()); + exParams.Setup(x => x.Writer).Returns(writer.Object); + var print = new Print(new Constant(223)) { Address = new HashAddress(1) }; - print.Execute(vm); + print.Execute(exParams.Object); writer.Verify(x => x.WriteLine( It.Is(v => v!.Equals(223)) ), Times.Once()); @@ -53,18 +59,18 @@ public void ProgramWithoutHaltWillNotRunTest() [Fact] public void VirtualMachineFramesClearedAfterExecutionTest() { - var program = new List - { + AddressedInstructions program = + [ new Simple("a", (new Constant(1), new Constant(2)), "+"), new AsString(new Name("a")) { Left = "s" }, new Halt() - }.ToAddressedInstructions(); + ]; _vm.Run(program); - Assert.Empty(_vm.Frames); + Assert.Empty(_vm.ExecuteParams.Frames); } [Fact] @@ -76,20 +82,21 @@ public void VirtualMachineHandlesRecursionTest() { new Goto(factorial.End), { new BeginBlock(BlockType.Function, blockId: factorial.ToString()), factorial.Start.Name }, + new PopParameter("n"), new Simple("_t2", (new Name("n"), new Constant(2)), "<"), new IfNotGoto(new Name("_t2"), new Label("5")), new Return(new Name("n")), { new Simple("_t5", (new Name("n"), new Constant(1)), "-"), "5" }, - new PushParameter("n", new Name("_t5")), - new CallFunction(factorial, 1, true) + new PushParameter(new Name("_t5")), + new CallFunction(factorial, true) { Left = "f" }, new Simple("_t8", (new Name("n"), new Name("f")), "*"), new Return(new Name("_t8")), { new EndBlock(BlockType.Function, blockId: factorial.ToString()), factorial.End.Name }, - new PushParameter("n", new Constant(6)), - new CallFunction(factorial, 1, true) + new PushParameter(new Constant(6)), + new CallFunction(factorial, true) { Left = "fa6" }, @@ -97,20 +104,20 @@ public void VirtualMachineHandlesRecursionTest() }; _vm.Run(program); - Assert.Empty(_vm.CallStack); - Assert.Empty(_vm.Arguments); + Assert.Empty(_vm.ExecuteParams.CallStack); + Assert.Empty(_vm.ExecuteParams.Arguments); halt.Verify(x => x.Execute( - It.Is( - vm => Convert.ToInt32(vm.Frames.Peek()["fa6"]) == 720 - ) - ), Times.Once()); - _vm.Frames.Pop(); + It.Is( + vm => + Convert.ToInt32(vm.Frames.Peek()["fa6"]) == 720)), + Times.Once()); + _vm.ExecuteParams.Frames.Pop(); } [Fact] public void CreateArrayReservesCertainSpaceTest() { - var vm = new VirtualMachine(); + var vm = new ExecuteParams(Console.Out); vm.Frames.Push(new Frame(new HashAddress(0))); var createArray = new CreateArray("arr", 6) @@ -139,19 +146,19 @@ public void CreateArrayReservesCertainSpaceTest() public void ObjectCreationTest() { var halt = new Mock().Trackable(); - var program = new List - { + AddressedInstructions program = + [ new CreateObject("obj"), new DotAssignment("obj", new Constant("prop"), new Constant(null, "null")), halt.Object - }.ToAddressedInstructions(); + ]; _vm.Run(program); halt.Verify(x => x.Execute( - It.Is( - vm => ((Dictionary)vm.Frames.Peek()["obj"]!)["prop"] == null - ) - ), Times.Once()); - _vm.Frames.Pop(); + It.Is( + vm => + ((Dictionary)vm.Frames.Peek()["obj"]!)["prop"] == null)), + Times.Once()); + _vm.ExecuteParams.Frames.Pop(); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs b/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs index 8433b945..4d2e3c37 100644 --- a/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs @@ -3,7 +3,7 @@ using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; using Moq; @@ -21,7 +21,7 @@ public void StorageIsEmptyAfterFlushTest() var symbol = new FunctionSymbol( id: functionName, - parameters: new List(), + parameters: [], "undefined", isEmpty: false); diff --git a/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs b/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs index 4f52e041..1e580628 100644 --- a/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs @@ -1,6 +1,5 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes; using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Symbols; +using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; using Moq; using Xunit; @@ -14,7 +13,7 @@ public void FindSymbolTest() const string id = "ident"; var type = new Mock(id); - var symbol = new Mock(); + var symbol = new Mock(); symbol.Setup(s => s.Id).Returns(id); symbol.Setup(s => s.Type).Returns(type.Object); @@ -23,39 +22,7 @@ public void FindSymbolTest() outerScope.AddSymbol(symbol.Object); innerScope.AddOpenScope(outerScope); - Assert.NotNull(innerScope.FindSymbol(id)); + Assert.NotNull(innerScope.FindSymbol(id)); Assert.True(outerScope.ContainsSymbol(id)); } - - [Fact] - public void FlatteningScopeTest() - { - var table = new SymbolTable(); - var stmtList = new List( - Enumerable.Repeat( - new Mock().Object, - new Random().Next(10) - ) - ); - var script = new ScriptBody(stmtList) - { - SymbolTable = table - }; - script.ToList().ForEach(node => node.SymbolTable = table); - - const string id = "ident"; - var type = new Mock(id); - - var symbol = new Mock(); - symbol.Setup(s => s.Id).Returns(id); - symbol.Setup(s => s.Type).Returns(type.Object); - - script.SymbolTable.AddSymbol(symbol.Object); - - Assert.All( - script.ToList(), - stmtListItem => - Assert.True(stmtListItem.SymbolTable.ContainsSymbol(id)) - ); - } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs index 5626f24e..7eafbdcd 100644 --- a/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs +++ b/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs @@ -1,8 +1,9 @@ using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Instructions; +using HydraScript.Lib.BackEnd.Impl.Instructions; using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.TopDownParse; using HydraScript.Lib.IR.Ast; +using HydraScript.Services.CodeGen; using HydraScript.Services.Executor.Impl; using HydraScript.Services.Parsing; using HydraScript.Services.SourceCode; @@ -25,13 +26,20 @@ public ExecutorTests() public void ExecuteGoesOkTest() { var ast = new Mock(); - ast.Setup(x => x.GetInstructions()) - .Returns(new AddressedInstructions { new Halt() }); + ast.Setup(x => x.Root) + .Returns(Mock.Of()); _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, Mock.Of()); + var codeGenService = new Mock(); + codeGenService.Setup(x => x.GetInstructions(It.IsAny())) + .Returns([new Halt()]); + + var executor = new Executor( + _parsingService.Object, + Mock.Of(), + codeGenService.Object); Assert.Null(Record.Exception(() => executor.Execute())); } @@ -39,51 +47,71 @@ public void ExecuteGoesOkTest() public void SemanticExceptionCaughtTest() { var ast = new Mock(); - ast.Setup(x => x.GetInstructions()) - .Throws(); + ast.Setup(x => x.Root) + .Returns(Mock.Of()); _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, Mock.Of()); + var codeGenService = new Mock(); + codeGenService.Setup(x => x.GetInstructions(It.IsAny())) + .Throws(); + + var executor = new Executor( + _parsingService.Object, + Mock.Of(), + codeGenService.Object); Assert.Null(Record.Exception(() => executor.Execute())); } - + [Fact] public void LexerExceptionCaughtTest() { _parsingService.Setup(x => x.Parse(It.IsAny())) .Throws(); - var executor = new Executor(_parsingService.Object, Mock.Of()); + var executor = new Executor( + _parsingService.Object, + Mock.Of(), + Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } - + [Fact] public void ParserExceptionCaughtTest() { _parsingService.Setup(x => x.Parse(It.IsAny())) .Throws(); - var executor = new Executor(_parsingService.Object, Mock.Of()); + var executor = new Executor( + _parsingService.Object, + Mock.Of(), + Mock.Of()); Assert.Null(Record.Exception(() => executor.Execute())); } - + [Fact] public void InternalInterpreterErrorCaughtTest() { - var instruction = new Mock(); - instruction.Setup(x => x.Execute(It.IsAny())) + var instruction = new Mock(); + instruction.Setup(x => x.Execute(It.IsAny())) .Throws(); - + var ast = new Mock(); - ast.Setup(x => x.GetInstructions()) - .Returns(new AddressedInstructions { instruction.Object, new Halt() }); + ast.Setup(x => x.Root) + .Returns(Mock.Of()); _parsingService.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); - var executor = new Executor(_parsingService.Object, Mock.Of()); + var codeGenService = new Mock(); + codeGenService.Setup(x => x.GetInstructions(It.IsAny())) + .Returns([instruction.Object, new Halt()]); + + var executor = new Executor( + _parsingService.Object, + Mock.Of(), + codeGenService.Object); Assert.Null(Record.Exception(() => executor.Execute())); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs index 1d97f9d5..fe7812c1 100644 --- a/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs +++ b/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs @@ -1,6 +1,4 @@ using System.IO.Abstractions; -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Instructions; using HydraScript.Lib.FrontEnd.GetTokens; using HydraScript.Lib.FrontEnd.GetTokens.Data; using HydraScript.Lib.FrontEnd.TopDownParse; @@ -46,14 +44,14 @@ public void CorrectFileNameProducedByLexerTest() It.Is(p => p == "file.tokens"), It.Is(c => c == "lexer") ), Times.Once()); } - + [Fact] public void CorrectTreeWrittenAndLoggingTreeProducedTest() { var ast = new Mock(); ast.Setup(x => x.ToString()) .Returns("digraph ast { }"); - + var parser = new Mock(); parser.Setup(x => x.TopDownParse(It.IsAny())) .Returns(ast.Object); @@ -62,33 +60,12 @@ public void CorrectTreeWrittenAndLoggingTreeProducedTest() It.IsAny(), It.IsAny() )).Verifiable(); - var loggingParser = new LoggingParser(parser.Object, "file", _fileSystem.Object); - var parsed = loggingParser.TopDownParse(""); + var loggingParser = new LoggingParser(parser.Object, _fileSystem.Object); + _ = loggingParser.TopDownParse(""); _file.Verify(x => x.WriteAllText( It.Is(p => p == "ast.dot"), It.Is(c => c == "digraph ast { }") ), Times.Once()); - Assert.IsType(parsed); - } - - [Fact] - public void CorrectFileNameProducedByTreeTest() - { - var ast = new Mock(); - ast.Setup(x => x.GetInstructions()) - .Returns(new AddressedInstructions { new Halt() }); - - _file.Setup(x => x.WriteAllLines( - It.IsAny(), It.IsAny>() - )).Verifiable(); - - var loggingTree = new LoggingAbstractSyntaxTree(ast.Object, "file", _fileSystem.Object); - loggingTree.GetInstructions(); - - _file.Verify(x => x.WriteAllLines( - It.Is(p => p == "file.tac"), - It.Is>(c => c.SequenceEqual(new[] { "\tEnd" })) - ), Times.Once()); } } \ No newline at end of file From 6e5e1959070bd54a5a9cda1a14d1c0d58ed56d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sun, 28 Jul 2024 03:07:16 +0300 Subject: [PATCH 16/35] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=BD=D0=B0=20=D1=87=D0=B8=D1=81=D1=82=D1=83=D1=8E=20?= =?UTF-8?q?=D0=B0=D1=80=D1=85=D0=B8=D1=82=D0=B5=D0=BA=D1=82=D1=83=D1=80?= =?UTF-8?q?=D1=83=20=D0=B8=20System.CommandLine=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #51 - Скелет Луковой Архитектуры * #51 - удалил мусор * #51 - перенос backend * #51 - fix * #51 - перенос FrontEnd * #51 - Перенос IR * #51 - перенос StaticAnalysis * #51 - перенос Code Generation * #51 - code gen di refac * #51 - fix * #51 - fix * #51 - static analysis di refac * #51 - fix * #51 fix * #51 - fix * #51 - fix * #51 - nuget upgrade * #51 - infrastructure layer * #42 - внедрил system command line * di fix * #51 - fix * #47 - интеграционные тесты * #47 - ci cd --- .github/workflows/develop.yml | 4 +- ExtendedJavaScriptSubset.sln | 65 ++++++++- .../GlobalUsings.cs | 3 + ...raScript.Application.CodeGeneration.csproj | 19 +++ .../ICodeGenerator.cs | 9 ++ .../IValueDtoConverter.cs | 9 ++ .../Impl/ValueDtoConverter.cs | 10 +- .../ServiceCollectionExtensions.cs | 22 +++ .../Visitors/ExpressionInstructionProvider.cs | 40 +++-- .../Visitors/InstructionProvider.cs | 38 ++--- .../Exceptions/ArrayAccessException.cs | 2 +- .../Exceptions/AssignmentToConst.cs | 4 +- .../Exceptions/CannotDefineType.cs | 2 +- .../Exceptions/ConstWithoutInitializer.cs | 4 +- .../Exceptions/DeclarationAlreadyExists.cs | 4 +- .../FunctionWithoutReturnStatement.cs | 2 +- .../Exceptions/IncompatibleTypesOfOperands.cs | 2 +- .../Exceptions/NonAccessibleType.cs | 2 +- .../Exceptions/NotBooleanTestExpression.cs | 2 +- .../Exceptions/ObjectAccessException.cs | 4 +- .../Exceptions/OutsideOfStatement.cs | 2 +- .../Exceptions/ReturnOutsideFunction.cs | 2 +- .../Exceptions/SemanticException.cs | 2 +- .../Exceptions/SymbolIsNotCallable.cs | 2 +- .../Exceptions/UnknownIdentifierReference.cs | 4 +- .../Exceptions/UnsupportedOperation.cs | 2 +- .../WrongArrayLiteralDeclaration.cs | 2 +- .../Exceptions/WrongAssignmentTarget.cs | 4 +- .../Exceptions/WrongConditionalTypes.cs | 2 +- .../Exceptions/WrongNumberOfArguments.cs | 2 +- .../Exceptions/WrongReturnType.cs | 2 +- .../Exceptions/WrongTypeOfArgument.cs | 2 +- .../GlobalUsings.cs | 4 + ...raScript.Application.StaticAnalysis.csproj | 23 +++ .../IComputedTypesStorage.cs | 8 + .../IDefaultValueForTypeCalculator.cs | 2 +- .../IFunctionWithUndefinedReturnStorage.cs | 15 ++ .../IJavaScriptTypesProvider.cs | 8 + .../IMethodStorage.cs | 11 ++ .../IStandardLibraryProvider.cs | 8 + .../IStaticAnalyzer.cs | 8 + .../ISymbolTableStorage.cs | 6 +- .../ITypeDeclarationsResolver.cs | 10 ++ .../Impl/ComputedTypesStorage.cs | 16 ++ .../Impl/DefaultValueForTypeCalculator.cs | 6 +- .../FunctionWithUndefinedReturnStorage.cs | 12 +- .../Impl/JavaScriptTypesProvider.cs | 6 +- .../Impl/MethodStorage.cs | 10 +- .../Impl/StandardLibraryProvider.cs | 10 +- .../Impl/SymbolTableStorage.cs | 10 +- .../Impl/TypeDeclarationsResolver.cs | 16 +- .../ServiceCollectionExtensions.cs | 34 +++++ .../Visitors/DeclarationVisitor.cs | 26 ++-- .../Visitors/SemanticChecker.cs | 65 +++++---- .../Visitors/SymbolTableInitializer.cs | 15 +- .../Visitors/TypeBuilder.cs | 17 +-- .../Visitors/TypeSystemLoader.cs | 15 +- .../AddressedInstructions.cs | 4 +- .../HydraScript.Domain.BackEnd}/Call.cs | 4 +- .../HydraScript.Domain.BackEnd}/Frame.cs | 2 +- .../HydraScript.Domain.BackEnd.csproj | 10 ++ .../HydraScript.Domain.BackEnd}/IAddress.cs | 2 +- .../IExecutableInstruction.cs | 2 +- .../IExecuteParams.cs | 2 +- .../HydraScript.Domain.BackEnd}/IValue.cs | 2 +- .../IVirtualMachine.cs | 2 +- .../Impl/Addresses/HashAddress.cs | 2 +- .../Impl/Addresses/Label.cs | 2 +- .../Impl/ExecuteParams.cs | 2 +- .../Impl/Instructions/BlockLabel.cs | 2 +- .../Impl/Instructions/Halt.cs | 4 +- .../Impl/Instructions/Instruction.cs | 2 +- .../Impl/Instructions/PopParameter.cs | 2 +- .../Impl/Instructions/Print.cs | 2 +- .../Impl/Instructions/PushParameter.cs | 2 +- .../Impl/Instructions/RemoveFromArray.cs | 2 +- .../Impl/Instructions/Return.cs | 2 +- .../Instructions/WithAssignment/AsString.cs | 2 +- .../WithAssignment/CallFunction.cs | 2 +- .../ComplexData/Create/CreateArray.cs | 2 +- .../ComplexData/Create/CreateObject.cs | 2 +- .../ComplexData/Read/DotRead.cs | 6 +- .../ComplexData/Read/IReadFromComplexData.cs | 2 +- .../ComplexData/Read/IndexRead.cs | 6 +- .../ComplexData/Write/DotAssignment.cs | 6 +- .../ComplexData/Write/IWriteToComplexData.cs | 6 + .../ComplexData/Write/IndexAssignment.cs | 6 +- .../Instructions/WithAssignment/Simple.cs | 2 +- .../Impl/Instructions/WithJump/Goto.cs | 4 +- .../Impl/Instructions/WithJump/IfNotGoto.cs | 4 +- .../Impl/Values/Constant.cs | 2 +- .../Impl/Values/Name.cs | 2 +- .../Impl/VirtualMachine.cs | 2 +- .../GlobalUsings.cs | 4 + .../HydraScript.Domain.FrontEnd.csproj} | 10 +- .../Lexer/ILexer.cs | 8 + .../Lexer/ITextCoordinateSystemComputer.cs | 6 + .../Lexer/Impl/RegexLexer.cs} | 5 +- .../Impl/TextCoordinateSystemComputer.cs | 2 +- .../Lexer}/LexerException.cs | 3 +- .../Lexer}/Structure.cs | 4 +- .../Lexer}/Token.cs | 4 +- .../Lexer}/TokenTypes/EndOfProgramType.cs | 2 +- .../Lexer}/TokenTypes/ErrorType.cs | 2 +- .../Lexer}/TokenTypes/IgnorableType.cs | 2 +- .../Lexer}/TokenTypes/TokenType.cs | 2 +- .../Lexer/TokenTypesJson.cs | 116 +++++++++++++++ .../Parser}/IAbstractSyntaxTree.cs | 2 +- .../Parser}/IAbstractSyntaxTreeNode.cs | 2 +- .../Parser/IParser.cs | 6 + .../Parser/Impl/Ast}/AbstractSyntaxTree.cs | 2 +- .../Impl/Ast}/AbstractSyntaxTreeNode.cs | 2 +- .../AfterTypesAreLoadedDeclaration.cs | 2 +- .../FunctionDeclaration.cs | 6 +- .../AfterTypesAreLoaded/LexicalDeclaration.cs | 4 +- .../Nodes/Declarations/TypeDeclaration.cs | 4 +- .../Impl/Ast}/Nodes/Declarations/TypeValue.cs | 4 +- .../AccessExpressions/AccessExpression.cs | 4 +- .../AccessExpressions/DotAccess.cs | 4 +- .../AccessExpressions/IndexAccess.cs | 2 +- .../Nodes/Expressions/AssignmentExpression.cs | 4 +- .../Nodes/Expressions/BinaryExpression.cs | 2 +- .../Ast}/Nodes/Expressions/CallExpression.cs | 4 +- .../Nodes/Expressions/CastAsExpression.cs | 4 +- .../ComplexLiterals/ArrayLiteral.cs | 2 +- .../ComplexLiterals/ComplexLiteral.cs | 2 +- .../ComplexLiterals/ObjectLiteral.cs | 2 +- .../Expressions/ComplexLiterals/Property.cs | 4 +- .../Expressions/ConditionalExpression.cs | 2 +- .../Impl/Ast}/Nodes/Expressions/Expression.cs | 2 +- .../Expressions/LeftHandSideExpression.cs | 10 ++ .../Nodes/Expressions/MemberExpression.cs | 8 +- .../PrimaryExpressions/AbstractLiteral.cs | 4 +- .../PrimaryExpressions/IdentifierReference.cs | 2 +- .../PrimaryExpressions/ImplicitLiteral.cs | 4 +- .../Expressions/PrimaryExpressions/Literal.cs | 4 +- .../PrimaryExpressions/PrimaryExpression.cs | 2 +- .../PrimaryExpressions/ValueDto.cs | 2 +- .../Ast}/Nodes/Expressions/UnaryExpression.cs | 2 +- .../Parser/Impl/Ast}/Nodes/ScriptBody.cs | 2 +- .../Impl/Ast}/Nodes/StatementListItem.cs | 2 +- .../Ast}/Nodes/Statements/BlockStatement.cs | 2 +- .../Nodes/Statements/ExpressionStatement.cs | 2 +- .../Impl/Ast}/Nodes/Statements/IfStatement.cs | 2 +- .../Nodes/Statements/InsideStatementJump.cs | 2 +- .../Ast}/Nodes/Statements/ReturnStatement.cs | 2 +- .../Ast}/Nodes/Statements/WhileStatement.cs | 2 +- .../Parser}/Impl/TokensStream.cs | 4 +- .../Parser/Impl/TopDownParser.cs} | 34 ++--- .../Parser}/ParserException.cs | 4 +- .../Parser}/Scope.cs | 2 +- .../HydraScript.Domain.IR/GlobalUsings.cs | 3 + .../HydraScript.Domain.IR.csproj | 10 ++ .../HydraScript.Domain.IR}/ISymbol.cs | 2 +- .../HydraScript.Domain.IR}/ISymbolTable.cs | 2 +- .../Impl/SymbolTable.cs | 2 +- .../Impl/Symbols/FunctionSymbol.cs | 2 +- .../Impl/Symbols/ObjectSymbol.cs | 4 +- .../Impl/Symbols/Symbol.cs | 2 +- .../Impl/Symbols/TypeSymbol.cs | 2 +- .../Impl/Symbols/VariableSymbol.cs | 2 +- .../HydraScript.Domain.IR}/Types/Any.cs | 2 +- .../HydraScript.Domain.IR}/Types/ArrayType.cs | 2 +- .../HydraScript.Domain.IR}/Types/NullType.cs | 2 +- .../Types/NullableType.cs | 2 +- .../Types/ObjectType.cs | 2 +- .../HydraScript.Domain.IR}/Types/Type.cs | 2 +- .../ComplexData/Write/IWriteToComplexData.cs | 6 - .../FrontEnd/GetTokens/ILexer.cs | 10 -- .../ITextCoordinateSystemComputer.cs | 6 - .../FrontEnd/TopDownParse/IParser.cs | 8 - src/HydraScript.Lib/GlobalUsings.cs | 5 - .../Expressions/LeftHandSideExpression.cs | 10 -- .../Visitors/Services/IValueDtoConverter.cs | 9 -- .../IFunctionWithUndefinedReturnStorage.cs | 15 -- .../Services/IJavaScriptTypesProvider.cs | 8 - .../Visitors/Services/IMethodStorage.cs | 11 -- .../Services/IStandardLibraryProvider.cs | 8 - .../Services/ITypeDeclarationsResolver.cs | 10 -- src/HydraScript/CommandLineSettings.cs | 30 ---- src/HydraScript/ExecuteCommand.cs | 23 +++ src/HydraScript/ExecuteCommandHandler.cs | 45 ++++++ src/HydraScript/HydraScript.csproj | 12 +- src/HydraScript/Program.cs | 82 ++++------- .../Services/CodeGen/ICodeGenService.cs | 9 -- .../Services/CodeGen/Impl/CodeGenService.cs | 75 ---------- .../Services/Executor/IExecutor.cs | 6 - .../Services/Executor/Impl/Executor.cs | 50 ------- .../Services/Parsing/IParsingService.cs | 8 - .../Services/Parsing/Impl/ParsingService.cs | 20 --- .../Providers/LexerProvider/ILexerProvider.cs | 8 - .../LexerProvider/Impl/LexerProvider.cs | 37 ----- .../LexerProvider/Impl/LoggingLexer.cs | 33 ----- .../ParserProvider/IParserProvider.cs | 8 - .../ParserProvider/Impl/LoggingParser.cs | 25 ---- .../ParserProvider/Impl/ParserProvider.cs | 33 ----- .../StructureProvider/IStructureProvider.cs | 8 - .../SourceCode/ISourceCodeProvider.cs | 6 - .../SourceCode/Impl/SourceCodeProvider.cs | 24 --- src/HydraScript/TokenTypes.cs | 116 --------------- .../CodeGenerator.cs | 30 ++++ .../HydraScript.Infrastructure.csproj | 25 ++++ .../ISourceCodeProvider.cs | 22 +++ .../HydraScript.Infrastructure/InputFile.cs | 6 + .../Logging/LoggingLexer.cs | 27 ++++ .../Logging/LoggingParser.cs | 15 ++ .../Logging/LoggingVirtualMachine.cs | 25 ++++ .../ServiceCollectionExtensions.cs | 55 +++++++ .../StaticAnalyzer.cs | 22 +++ .../StructureInstance.cs} | 31 ++-- .../GlobalUsings.cs | 3 + .../HydraScript.IntegrationTests.csproj | 138 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 1 + .../SuccessfulProgramsTests.cs | 51 +++++++ .../TestHostFixture.cs | 36 +++++ tests/HydraScript.Tests/GlobalUsings.cs | 3 +- .../Helpers/MockExtensions.cs | 6 +- .../HydraScript.Tests.csproj | 16 +- .../Stubs/SemanticExceptionStub.cs | 2 +- .../TestData/InstructionsData.cs | 16 +- .../BackEnd/AddressedInstructionsTests.cs | 10 +- .../Unit/BackEnd/CallTests.cs | 4 +- .../Unit/BackEnd/HashAddressTests.cs | 2 +- .../Unit/BackEnd/InstructionsTests.cs | 6 +- .../Unit/BackEnd/ValuesTests.cs | 2 +- .../Unit/BackEnd/VirtualMachineTests.cs | 18 +-- .../{LexerTests.cs => RegexLexerTests.cs} | 26 ++-- .../Unit/FrontEnd/StructureTests.cs | 4 +- .../TextCoordinateSystemComputerTests.cs | 4 +- .../{ParserTests.cs => TopDownParserTests.cs} | 17 +-- .../HydraScript.Tests/Unit/IR/AstNodeTests.cs | 13 +- ...FunctionWithUndefinedReturnStorageTests.cs | 16 +- .../Unit/IR/SymbolTableTests.cs | 4 +- .../Unit/IR/Types/ObjectTypeTests.cs | 2 +- .../Unit/IR/Types/TypeTests.cs | 4 +- .../Unit/Infrastructure/ExecutorTests.cs | 117 --------------- .../Infrastructure/LoggingEntitiesTests.cs | 47 +++--- .../Infrastructure/ParsingServiceTests.cs | 33 ----- .../Unit/Infrastructure/ProvidersTests.cs | 70 --------- 239 files changed, 1478 insertions(+), 1344 deletions(-) create mode 100644 src/Application/HydraScript.Application.CodeGeneration/GlobalUsings.cs create mode 100644 src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj create mode 100644 src/Application/HydraScript.Application.CodeGeneration/ICodeGenerator.cs create mode 100644 src/Application/HydraScript.Application.CodeGeneration/IValueDtoConverter.cs rename src/{HydraScript.Lib/IR/Ast/Visitors/Services => Application/HydraScript.Application.CodeGeneration}/Impl/ValueDtoConverter.cs (56%) create mode 100644 src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs rename src/{HydraScript.Lib/IR/Ast => Application/HydraScript.Application.CodeGeneration}/Visitors/ExpressionInstructionProvider.cs (90%) rename src/{HydraScript.Lib/IR/Ast => Application/HydraScript.Application.CodeGeneration}/Visitors/InstructionProvider.cs (85%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/ArrayAccessException.cs (80%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/AssignmentToConst.cs (57%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/CannotDefineType.cs (72%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/ConstWithoutInitializer.cs (59%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/DeclarationAlreadyExists.cs (59%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/FunctionWithoutReturnStatement.cs (78%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/IncompatibleTypesOfOperands.cs (79%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/NonAccessibleType.cs (75%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/NotBooleanTestExpression.cs (78%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/ObjectAccessException.cs (69%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/OutsideOfStatement.cs (79%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/ReturnOutsideFunction.cs (74%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/SemanticException.cs (88%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/SymbolIsNotCallable.cs (76%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/UnknownIdentifierReference.cs (59%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/UnsupportedOperation.cs (79%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongArrayLiteralDeclaration.cs (81%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongAssignmentTarget.cs (68%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongConditionalTypes.cs (84%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongNumberOfArguments.cs (81%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongReturnType.cs (80%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Exceptions/WrongTypeOfArgument.cs (80%) create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/GlobalUsings.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IComputedTypesStorage.cs rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/IDefaultValueForTypeCalculator.cs (62%) create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IFunctionWithUndefinedReturnStorage.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IJavaScriptTypesProvider.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IMethodStorage.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IStandardLibraryProvider.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/IStaticAnalyzer.cs rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/ISymbolTableStorage.cs (58%) create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/ITypeDeclarationsResolver.cs create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/Impl/ComputedTypesStorage.cs rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/DefaultValueForTypeCalculator.cs (79%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/FunctionWithUndefinedReturnStorage.cs (72%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/JavaScriptTypesProvider.cs (62%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/MethodStorage.cs (68%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/StandardLibraryProvider.cs (69%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/SymbolTableStorage.cs (70%) rename src/{HydraScript.Lib/IR/CheckSemantics/Visitors/Services => Application/HydraScript.Application.StaticAnalysis}/Impl/TypeDeclarationsResolver.cs (82%) create mode 100644 src/Application/HydraScript.Application.StaticAnalysis/ServiceCollectionExtensions.cs rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Visitors/DeclarationVisitor.cs (80%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Visitors/SemanticChecker.cs (90%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Visitors/SymbolTableInitializer.cs (77%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Visitors/TypeBuilder.cs (71%) rename src/{HydraScript.Lib/IR/CheckSemantics => Application/HydraScript.Application.StaticAnalysis}/Visitors/TypeSystemLoader.cs (76%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/AddressedInstructions.cs (96%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Call.cs (80%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Frame.cs (91%) create mode 100644 src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/IAddress.cs (69%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/IExecutableInstruction.cs (82%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/IExecuteParams.cs (84%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/IValue.cs (67%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/IVirtualMachine.cs (79%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Addresses/HashAddress.cs (91%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Addresses/Label.cs (87%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/ExecuteParams.cs (86%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/BlockLabel.cs (94%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/Halt.cs (73%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/Instruction.cs (91%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/PopParameter.cs (87%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/Print.cs (85%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/PushParameter.cs (86%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/RemoveFromArray.cs (88%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/Return.cs (90%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/AsString.cs (91%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/CallFunction.cs (90%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs (81%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs (81%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs (71%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs (59%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs (67%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs (76%) create mode 100644 src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs (75%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithAssignment/Simple.cs (97%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithJump/Goto.cs (83%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Instructions/WithJump/IfNotGoto.cs (81%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Values/Constant.cs (89%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/Values/Name.cs (84%) rename src/{HydraScript.Lib/BackEnd => Domain/HydraScript.Domain.BackEnd}/Impl/VirtualMachine.cs (93%) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/GlobalUsings.cs rename src/{HydraScript.Lib/HydraScript.Lib.csproj => Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj} (50%) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITextCoordinateSystemComputer.cs rename src/{HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs => Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs} (86%) rename src/{HydraScript.Lib/FrontEnd/GetTokens => Domain/HydraScript.Domain.FrontEnd/Lexer}/Impl/TextCoordinateSystemComputer.cs (94%) rename src/{HydraScript.Lib/FrontEnd/GetTokens => Domain/HydraScript.Domain.FrontEnd/Lexer}/LexerException.cs (81%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/Structure.cs (92%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/Token.cs (93%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/TokenTypes/EndOfProgramType.cs (67%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/TokenTypes/ErrorType.cs (65%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/TokenTypes/IgnorableType.cs (72%) rename src/{HydraScript.Lib/FrontEnd/GetTokens/Data => Domain/HydraScript.Domain.FrontEnd/Lexer}/TokenTypes/TokenType.cs (83%) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs rename src/{HydraScript.Lib/IR/Ast => Domain/HydraScript.Domain.FrontEnd/Parser}/IAbstractSyntaxTree.cs (66%) rename src/{HydraScript.Lib/IR/Ast => Domain/HydraScript.Domain.FrontEnd/Parser}/IAbstractSyntaxTreeNode.cs (87%) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Parser/IParser.cs rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/AbstractSyntaxTree.cs (92%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/AbstractSyntaxTreeNode.cs (97%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs (66%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs (87%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs (80%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Declarations/TypeDeclaration.cs (77%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Declarations/TypeValue.cs (86%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/AccessExpressions/AccessExpression.cs (79%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/AccessExpressions/DotAccess.cs (73%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/AccessExpressions/IndexAccess.cs (83%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/AssignmentExpression.cs (87%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/BinaryExpression.cs (89%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/CallExpression.cs (84%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/CastAsExpression.cs (83%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs (86%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs (67%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs (86%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/ComplexLiterals/Property.cs (80%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/ConditionalExpression.cs (90%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/Expression.cs (70%) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/LeftHandSideExpression.cs rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/MemberExpression.cs (78%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs (66%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs (82%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs (75%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/Literal.cs (77%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs (61%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/PrimaryExpressions/ValueDto.cs (81%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Expressions/UnaryExpression.cs (87%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/ScriptBody.cs (93%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/StatementListItem.cs (75%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/BlockStatement.cs (92%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/ExpressionStatement.cs (86%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/IfStatement.cs (92%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/InsideStatementJump.cs (81%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/ReturnStatement.cs (87%) rename src/{HydraScript.Lib/IR/Ast/Impl => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast}/Nodes/Statements/WhileStatement.cs (88%) rename src/{HydraScript.Lib/FrontEnd/TopDownParse => Domain/HydraScript.Domain.FrontEnd/Parser}/Impl/TokensStream.cs (85%) rename src/{HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs => Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs} (96%) rename src/{HydraScript.Lib/FrontEnd/TopDownParse => Domain/HydraScript.Domain.FrontEnd/Parser}/ParserException.cs (84%) rename src/{HydraScript.Lib/IR/Ast => Domain/HydraScript.Domain.FrontEnd/Parser}/Scope.cs (84%) create mode 100644 src/Domain/HydraScript.Domain.IR/GlobalUsings.cs create mode 100644 src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/ISymbol.cs (61%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/ISymbolTable.cs (95%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/SymbolTable.cs (94%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/Symbols/FunctionSymbol.cs (91%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/Symbols/ObjectSymbol.cs (63%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/Symbols/Symbol.cs (69%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/Symbols/TypeSymbol.cs (85%) rename src/{HydraScript.Lib/IR/CheckSemantics/Variables => Domain/HydraScript.Domain.IR}/Impl/Symbols/VariableSymbol.cs (78%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/Any.cs (75%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/ArrayType.cs (93%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/NullType.cs (80%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/NullableType.cs (94%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/ObjectType.cs (99%) rename src/{HydraScript.Lib/IR/CheckSemantics => Domain/HydraScript.Domain.IR}/Types/Type.cs (94%) delete mode 100644 src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs delete mode 100644 src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs delete mode 100644 src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs delete mode 100644 src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs delete mode 100644 src/HydraScript.Lib/GlobalUsings.cs delete mode 100644 src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs delete mode 100644 src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs delete mode 100644 src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs delete mode 100644 src/HydraScript/CommandLineSettings.cs create mode 100644 src/HydraScript/ExecuteCommand.cs create mode 100644 src/HydraScript/ExecuteCommandHandler.cs delete mode 100644 src/HydraScript/Services/CodeGen/ICodeGenService.cs delete mode 100644 src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs delete mode 100644 src/HydraScript/Services/Executor/IExecutor.cs delete mode 100644 src/HydraScript/Services/Executor/Impl/Executor.cs delete mode 100644 src/HydraScript/Services/Parsing/IParsingService.cs delete mode 100644 src/HydraScript/Services/Parsing/Impl/ParsingService.cs delete mode 100644 src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs delete mode 100644 src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs delete mode 100644 src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs delete mode 100644 src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs delete mode 100644 src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs delete mode 100644 src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs delete mode 100644 src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs delete mode 100644 src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs delete mode 100644 src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs delete mode 100644 src/HydraScript/TokenTypes.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj create mode 100644 src/Infrastructure/HydraScript.Infrastructure/ISourceCodeProvider.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/InputFile.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingParser.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingVirtualMachine.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/StaticAnalyzer.cs rename src/{HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs => Infrastructure/HydraScript.Infrastructure/StructureInstance.cs} (68%) create mode 100644 tests/HydraScript.IntegrationTests/GlobalUsings.cs create mode 100644 tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj create mode 100644 tests/HydraScript.IntegrationTests/Properties/AssemblyInfo.cs create mode 100644 tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs create mode 100644 tests/HydraScript.IntegrationTests/TestHostFixture.cs rename tests/HydraScript.Tests/Unit/FrontEnd/{LexerTests.cs => RegexLexerTests.cs} (51%) rename tests/HydraScript.Tests/Unit/FrontEnd/{ParserTests.cs => TopDownParserTests.cs} (50%) delete mode 100644 tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs delete mode 100644 tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs delete mode 100644 tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 100370ab..53c44747 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -35,7 +35,7 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore -c Release -v n - - name: Test + - name: Unit Tests run: | dotnet test -c Release --no-build -v n --filter="Category=Unit" mkdir coverage-report @@ -74,3 +74,5 @@ jobs: with: name: CoverageReport path: coverage-report + - name: Integration Tests + run: dotnet test -c Release --no-build -v n --filter="Category=Integration" diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index 67301016..d5eba20e 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -1,7 +1,5 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Lib", "src\HydraScript.Lib\HydraScript.Lib.csproj", "{83524079-4A56-4AF0-9011-F7CA871536E9}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript", "src\HydraScript\HydraScript.csproj", "{5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Tests", "tests\HydraScript.Tests\HydraScript.Tests.csproj", "{F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}" @@ -70,16 +68,32 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-194 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{3F131901-A9EC-451A-B7E9-726887CFE5FB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{A280C99E-0112-4F3C-A5E9-B793F2D9898E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{F0FC6D23-F932-4C11-8D0F-07894FC61511}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{B7DDF6C9-B67C-430A-948A-A380EF68DEF1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Domain.FrontEnd", "src\Domain\HydraScript.Domain.FrontEnd\HydraScript.Domain.FrontEnd.csproj", "{B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Domain.IR", "src\Domain\HydraScript.Domain.IR\HydraScript.Domain.IR.csproj", "{BB913678-CB63-43BA-9C78-40D9A1FE85D9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Domain.BackEnd", "src\Domain\HydraScript.Domain.BackEnd\HydraScript.Domain.BackEnd.csproj", "{2B32BBCC-4562-4253-B85B-80E8A278551F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Application.StaticAnalysis", "src\Application\HydraScript.Application.StaticAnalysis\HydraScript.Application.StaticAnalysis.csproj", "{01376DD7-A13C-476C-A8DB-44EA9BB3F64F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Application.CodeGeneration", "src\Application\HydraScript.Application.CodeGeneration\HydraScript.Application.CodeGeneration.csproj", "{07DEA726-9772-4B61-AA66-1B82823F6BF0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Infrastructure", "src\Infrastructure\HydraScript.Infrastructure\HydraScript.Infrastructure.csproj", "{160B77ED-BA30-40A2-81EF-F5D1E4D22039}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.IntegrationTests", "tests\HydraScript.IntegrationTests\HydraScript.IntegrationTests.csproj", "{1CE98127-3027-4BD4-AAA3-63A589B09E73}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {83524079-4A56-4AF0-9011-F7CA871536E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83524079-4A56-4AF0-9011-F7CA871536E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83524079-4A56-4AF0-9011-F7CA871536E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83524079-4A56-4AF0-9011-F7CA871536E9}.Release|Any CPU.Build.0 = Release|Any CPU {5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {5DA79C0C-2B98-4E64-81EA-92AFFC5204D3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -88,13 +102,50 @@ Global {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B}.Release|Any CPU.Build.0 = Release|Any CPU + {B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD}.Release|Any CPU.Build.0 = Release|Any CPU + {BB913678-CB63-43BA-9C78-40D9A1FE85D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB913678-CB63-43BA-9C78-40D9A1FE85D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB913678-CB63-43BA-9C78-40D9A1FE85D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB913678-CB63-43BA-9C78-40D9A1FE85D9}.Release|Any CPU.Build.0 = Release|Any CPU + {2B32BBCC-4562-4253-B85B-80E8A278551F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B32BBCC-4562-4253-B85B-80E8A278551F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B32BBCC-4562-4253-B85B-80E8A278551F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B32BBCC-4562-4253-B85B-80E8A278551F}.Release|Any CPU.Build.0 = Release|Any CPU + {01376DD7-A13C-476C-A8DB-44EA9BB3F64F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {01376DD7-A13C-476C-A8DB-44EA9BB3F64F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {01376DD7-A13C-476C-A8DB-44EA9BB3F64F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {01376DD7-A13C-476C-A8DB-44EA9BB3F64F}.Release|Any CPU.Build.0 = Release|Any CPU + {07DEA726-9772-4B61-AA66-1B82823F6BF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {07DEA726-9772-4B61-AA66-1B82823F6BF0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {07DEA726-9772-4B61-AA66-1B82823F6BF0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {07DEA726-9772-4B61-AA66-1B82823F6BF0}.Release|Any CPU.Build.0 = Release|Any CPU + {160B77ED-BA30-40A2-81EF-F5D1E4D22039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {160B77ED-BA30-40A2-81EF-F5D1E4D22039}.Debug|Any CPU.Build.0 = Debug|Any CPU + {160B77ED-BA30-40A2-81EF-F5D1E4D22039}.Release|Any CPU.ActiveCfg = Release|Any CPU + {160B77ED-BA30-40A2-81EF-F5D1E4D22039}.Release|Any CPU.Build.0 = Release|Any CPU + {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {54CBE5A7-3C3E-44ED-B877-7B08A818083B} = {86CF2A2F-4DFE-48E7-B062-EF824730916A} {C7773DC6-9052-4F69-B947-CBFD5D663E80} = {54CBE5A7-3C3E-44ED-B877-7B08A818083B} {0E31199C-4893-4920-A356-D1FF7850BFAD} = {54CBE5A7-3C3E-44ED-B877-7B08A818083B} {5DA79C0C-2B98-4E64-81EA-92AFFC5204D3} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} - {83524079-4A56-4AF0-9011-F7CA871536E9} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} {F0DD56CB-C68A-4CDC-AA54-0A07342FE08B} = {3F131901-A9EC-451A-B7E9-726887CFE5FB} + {A280C99E-0112-4F3C-A5E9-B793F2D9898E} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} + {F0FC6D23-F932-4C11-8D0F-07894FC61511} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} + {B7DDF6C9-B67C-430A-948A-A380EF68DEF1} = {FB8F6EE1-1942-46D6-954E-9A1647BBDF10} + {B7FD15B2-A3C4-4A17-B6DE-CC87E35DFCCD} = {F0FC6D23-F932-4C11-8D0F-07894FC61511} + {BB913678-CB63-43BA-9C78-40D9A1FE85D9} = {F0FC6D23-F932-4C11-8D0F-07894FC61511} + {2B32BBCC-4562-4253-B85B-80E8A278551F} = {F0FC6D23-F932-4C11-8D0F-07894FC61511} + {01376DD7-A13C-476C-A8DB-44EA9BB3F64F} = {A280C99E-0112-4F3C-A5E9-B793F2D9898E} + {07DEA726-9772-4B61-AA66-1B82823F6BF0} = {A280C99E-0112-4F3C-A5E9-B793F2D9898E} + {160B77ED-BA30-40A2-81EF-F5D1E4D22039} = {B7DDF6C9-B67C-430A-948A-A380EF68DEF1} + {1CE98127-3027-4BD4-AAA3-63A589B09E73} = {3F131901-A9EC-451A-B7E9-726887CFE5FB} EndGlobalSection EndGlobal diff --git a/src/Application/HydraScript.Application.CodeGeneration/GlobalUsings.cs b/src/Application/HydraScript.Application.CodeGeneration/GlobalUsings.cs new file mode 100644 index 00000000..dcfa2c76 --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Visitor.NET; \ No newline at end of file diff --git a/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj b/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj new file mode 100644 index 00000000..d2c705b4 --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj @@ -0,0 +1,19 @@ + + + + net8.0 + enable + enable + True + + + + + + + + + + + + diff --git a/src/Application/HydraScript.Application.CodeGeneration/ICodeGenerator.cs b/src/Application/HydraScript.Application.CodeGeneration/ICodeGenerator.cs new file mode 100644 index 00000000..0c960e2f --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/ICodeGenerator.cs @@ -0,0 +1,9 @@ +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.FrontEnd.Parser; + +namespace HydraScript.Application.CodeGeneration; + +public interface ICodeGenerator +{ + public AddressedInstructions GetInstructions(IAbstractSyntaxTree ast); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.CodeGeneration/IValueDtoConverter.cs b/src/Application/HydraScript.Application.CodeGeneration/IValueDtoConverter.cs new file mode 100644 index 00000000..36d70216 --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/IValueDtoConverter.cs @@ -0,0 +1,9 @@ +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Application.CodeGeneration; + +public interface IValueDtoConverter +{ + public IValue Convert(ValueDto dto); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs b/src/Application/HydraScript.Application.CodeGeneration/Impl/ValueDtoConverter.cs similarity index 56% rename from src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs rename to src/Application/HydraScript.Application.CodeGeneration/Impl/ValueDtoConverter.cs index fa350339..ee3f919b 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/Services/Impl/ValueDtoConverter.cs +++ b/src/Application/HydraScript.Application.CodeGeneration/Impl/ValueDtoConverter.cs @@ -1,10 +1,10 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Values; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Values; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Visitors.Services.Impl; +namespace HydraScript.Application.CodeGeneration.Impl; -public class ValueDtoConverter : IValueDtoConverter +internal class ValueDtoConverter : IValueDtoConverter { public IValue Convert(ValueDto dto) => dto switch diff --git a/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs b/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..b379d093 --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs @@ -0,0 +1,22 @@ +using HydraScript.Application.CodeGeneration.Impl; +using HydraScript.Application.CodeGeneration.Visitors; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.FrontEnd.Parser; +using Microsoft.Extensions.DependencyInjection; + +namespace HydraScript.Application.CodeGeneration; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddCodeGeneration(this IServiceCollection services) + { + services.AddSingleton(); + services.AddKeyedSingleton< + IVisitor, + InstructionProvider>("instructions"); + services.AddKeyedSingleton< + IVisitor, + ExpressionInstructionProvider>("expression-instructions"); + return services; + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs b/src/Application/HydraScript.Application.CodeGeneration/Visitors/ExpressionInstructionProvider.cs similarity index 90% rename from src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs rename to src/Application/HydraScript.Application.CodeGeneration/Visitors/ExpressionInstructionProvider.cs index 9a8c3412..731d085f 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/ExpressionInstructionProvider.cs +++ b/src/Application/HydraScript.Application.CodeGeneration/Visitors/ExpressionInstructionProvider.cs @@ -1,21 +1,21 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Impl.Values; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Visitors.Services; - -namespace HydraScript.Lib.IR.Ast.Visitors; - -public class ExpressionInstructionProvider : VisitorBase, +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Domain.BackEnd.Impl.Values; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Application.CodeGeneration.Visitors; + +internal class ExpressionInstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -32,10 +32,8 @@ public class ExpressionInstructionProvider : VisitorBase _valueDtoConverter = valueDtoConverter; - } public AddressedInstructions Visit(PrimaryExpression visitable) => [new Simple(_valueDtoConverter.Convert(visitable.ToValueDto()))]; diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs b/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs similarity index 85% rename from src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs rename to src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs index a2199b14..9a30ebb4 100644 --- a/src/HydraScript.Lib/IR/Ast/Visitors/InstructionProvider.cs +++ b/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs @@ -1,18 +1,19 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Impl.Values; -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.Ast.Visitors.Services; - -namespace HydraScript.Lib.IR.Ast.Visitors; - -public class InstructionProvider : VisitorBase, +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Domain.BackEnd.Impl.Values; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; +using Microsoft.Extensions.DependencyInjection; + +namespace HydraScript.Application.CodeGeneration.Visitors; + +internal class InstructionProvider : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -26,10 +27,13 @@ public class InstructionProvider : VisitorBase _expressionVisitor; - public InstructionProvider(IValueDtoConverter valueDtoConverter) + public InstructionProvider( + IValueDtoConverter valueDtoConverter, + [FromKeyedServices("expression-instructions")] + IVisitor expressionVisitor) { _valueDtoConverter = valueDtoConverter; - _expressionVisitor = new ExpressionInstructionProvider(_valueDtoConverter); + _expressionVisitor = expressionVisitor; } public AddressedInstructions Visit(ScriptBody visitable) diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ArrayAccessException.cs similarity index 80% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ArrayAccessException.cs index 7884cdc4..e442bc98 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ArrayAccessException.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ArrayAccessException.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class ArrayAccessException(string segment, Type type) : SemanticException( diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/AssignmentToConst.cs similarity index 57% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/AssignmentToConst.cs index afe0b251..f78397b2 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/AssignmentToConst.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/AssignmentToConst.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class AssignmentToConst(IdentifierReference ident) diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/CannotDefineType.cs similarity index 72% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/CannotDefineType.cs index 357b09e3..6c568f49 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/CannotDefineType.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/CannotDefineType.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class CannotDefineType(string segment) : SemanticException(segment, "Cannot define type"); \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ConstWithoutInitializer.cs similarity index 59% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ConstWithoutInitializer.cs index 76ace72f..b510b18b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ConstWithoutInitializer.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ConstWithoutInitializer.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class ConstWithoutInitializer(IdentifierReference ident) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/DeclarationAlreadyExists.cs similarity index 59% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/DeclarationAlreadyExists.cs index 6ac5ed25..82ca2b0f 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/DeclarationAlreadyExists.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/DeclarationAlreadyExists.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class DeclarationAlreadyExists(IdentifierReference ident) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/FunctionWithoutReturnStatement.cs similarity index 78% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/FunctionWithoutReturnStatement.cs index fcf9fb6c..5289cc1b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/FunctionWithoutReturnStatement.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/FunctionWithoutReturnStatement.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class FunctionWithoutReturnStatement(string segment) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/IncompatibleTypesOfOperands.cs similarity index 79% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/IncompatibleTypesOfOperands.cs index eb7bfd52..7018af53 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/IncompatibleTypesOfOperands.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/IncompatibleTypesOfOperands.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class IncompatibleTypesOfOperands(string segment, Type left, Type right) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NonAccessibleType.cs similarity index 75% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NonAccessibleType.cs index a2edae72..2dea4327 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NonAccessibleType.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NonAccessibleType.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class NonAccessibleType(Type type) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NotBooleanTestExpression.cs similarity index 78% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NotBooleanTestExpression.cs index f1d5040c..e06bb7ff 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/NotBooleanTestExpression.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/NotBooleanTestExpression.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class NotBooleanTestExpression(string segment, Type type) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ObjectAccessException.cs similarity index 69% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ObjectAccessException.cs index 59e8183d..c937d928 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ObjectAccessException.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ObjectAccessException.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class ObjectAccessException(string segment, ObjectType objectType, string field) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/OutsideOfStatement.cs similarity index 79% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/OutsideOfStatement.cs index 61ec09f8..b624ba13 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/OutsideOfStatement.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/OutsideOfStatement.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class OutsideOfStatement(string segment, string keyword, string statement) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ReturnOutsideFunction.cs similarity index 74% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ReturnOutsideFunction.cs index d2898af8..1f095a0b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/ReturnOutsideFunction.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/ReturnOutsideFunction.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class ReturnOutsideFunction(string segment) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SemanticException.cs similarity index 88% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SemanticException.cs index c2dcb1b6..f68e4ec7 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SemanticException.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SemanticException.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [Serializable, ExcludeFromCodeCoverage] public abstract class SemanticException : Exception diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SymbolIsNotCallable.cs similarity index 76% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SymbolIsNotCallable.cs index f8eaede5..e11ec498 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/SymbolIsNotCallable.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/SymbolIsNotCallable.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class SymbolIsNotCallable(string symbol, string segment) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnknownIdentifierReference.cs similarity index 59% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnknownIdentifierReference.cs index 8476d9ad..e12fb35c 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnknownIdentifierReference.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnknownIdentifierReference.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class UnknownIdentifierReference(IdentifierReference ident) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnsupportedOperation.cs similarity index 79% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnsupportedOperation.cs index 996a1707..028e386e 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/UnsupportedOperation.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/UnsupportedOperation.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class UnsupportedOperation(string segment, Type type, string @operator) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongArrayLiteralDeclaration.cs similarity index 81% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongArrayLiteralDeclaration.cs index 846d8230..bef135e8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongArrayLiteralDeclaration.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongArrayLiteralDeclaration.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongArrayLiteralDeclaration(string segment, Type type) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongAssignmentTarget.cs similarity index 68% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongAssignmentTarget.cs index 5cb6b460..2f781f57 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongAssignmentTarget.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongAssignmentTarget.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongAssignmentTarget(LeftHandSideExpression lhs) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongConditionalTypes.cs similarity index 84% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongConditionalTypes.cs index 458d4323..57a90f95 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongConditionalTypes.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongConditionalTypes.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongConditionalTypes( diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongNumberOfArguments.cs similarity index 81% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongNumberOfArguments.cs index 0da12f04..b77f7337 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongNumberOfArguments.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongNumberOfArguments.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongNumberOfArguments(string segment, int expected, int actual) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongReturnType.cs similarity index 80% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongReturnType.cs index 68ae9d53..c204f652 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongReturnType.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongReturnType.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongReturnType(string segment, Type expected, Type actual) : diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongTypeOfArgument.cs similarity index 80% rename from src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongTypeOfArgument.cs index 8dc8c19b..b89010be 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Exceptions/WrongTypeOfArgument.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Exceptions/WrongTypeOfArgument.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace HydraScript.Lib.IR.CheckSemantics.Exceptions; +namespace HydraScript.Application.StaticAnalysis.Exceptions; [ExcludeFromCodeCoverage] public class WrongTypeOfArgument(string segment, Type expected, Type actual) : diff --git a/src/Application/HydraScript.Application.StaticAnalysis/GlobalUsings.cs b/src/Application/HydraScript.Application.StaticAnalysis/GlobalUsings.cs new file mode 100644 index 00000000..e00ba324 --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/GlobalUsings.cs @@ -0,0 +1,4 @@ +// Global using directives + +global using Type = HydraScript.Domain.IR.Types.Type; +global using Visitor.NET; \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj b/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj new file mode 100644 index 00000000..823f0c2b --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj @@ -0,0 +1,23 @@ + + + + net8.0 + enable + enable + True + + + + + + + + + + + + + + + + diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IComputedTypesStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/IComputedTypesStorage.cs new file mode 100644 index 00000000..a6ea02e1 --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IComputedTypesStorage.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Application.StaticAnalysis; + +public interface IComputedTypesStorage +{ + public Guid Save(Type computedType); + + public Type Get(Guid computedTypeGuid); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs b/src/Application/HydraScript.Application.StaticAnalysis/IDefaultValueForTypeCalculator.cs similarity index 62% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs rename to src/Application/HydraScript.Application.StaticAnalysis/IDefaultValueForTypeCalculator.cs index 9d0b66f5..ba34c898 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IDefaultValueForTypeCalculator.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/IDefaultValueForTypeCalculator.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +namespace HydraScript.Application.StaticAnalysis; public interface IDefaultValueForTypeCalculator { diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IFunctionWithUndefinedReturnStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/IFunctionWithUndefinedReturnStorage.cs new file mode 100644 index 00000000..0c725a8c --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IFunctionWithUndefinedReturnStorage.cs @@ -0,0 +1,15 @@ +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.IR.Impl.Symbols; + +namespace HydraScript.Application.StaticAnalysis; + +public interface IFunctionWithUndefinedReturnStorage +{ + public void Save(FunctionSymbol symbol, FunctionDeclaration declaration); + + public FunctionDeclaration Get(FunctionSymbol symbol); + + public void RemoveIfPresent(FunctionSymbol symbol); + + public IEnumerable Flush(); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IJavaScriptTypesProvider.cs b/src/Application/HydraScript.Application.StaticAnalysis/IJavaScriptTypesProvider.cs new file mode 100644 index 00000000..42e79dac --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IJavaScriptTypesProvider.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Application.StaticAnalysis; + +public interface IJavaScriptTypesProvider +{ + public IEnumerable GetDefaultTypes(); + + public bool Contains(Type type); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IMethodStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/IMethodStorage.cs new file mode 100644 index 00000000..9adf811d --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IMethodStorage.cs @@ -0,0 +1,11 @@ +using HydraScript.Domain.IR.Impl.Symbols; +using HydraScript.Domain.IR.Types; + +namespace HydraScript.Application.StaticAnalysis; + +public interface IMethodStorage +{ + public void BindMethod(ObjectType objectType, FunctionSymbol method); + + public IReadOnlyDictionary GetAvailableMethods(ObjectType objectType); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IStandardLibraryProvider.cs b/src/Application/HydraScript.Application.StaticAnalysis/IStandardLibraryProvider.cs new file mode 100644 index 00000000..5b83c00b --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IStandardLibraryProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Domain.IR; + +namespace HydraScript.Application.StaticAnalysis; + +public interface IStandardLibraryProvider +{ + public ISymbolTable GetStandardLibrary(); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/IStaticAnalyzer.cs b/src/Application/HydraScript.Application.StaticAnalysis/IStaticAnalyzer.cs new file mode 100644 index 00000000..d4ee79c0 --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/IStaticAnalyzer.cs @@ -0,0 +1,8 @@ +using HydraScript.Domain.FrontEnd.Parser; + +namespace HydraScript.Application.StaticAnalysis; + +public interface IStaticAnalyzer +{ + public void Analyze(IAbstractSyntaxTree ast); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/ISymbolTableStorage.cs similarity index 58% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs rename to src/Application/HydraScript.Application.StaticAnalysis/ISymbolTableStorage.cs index 900b5b9b..038669e0 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ISymbolTableStorage.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/ISymbolTableStorage.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.CheckSemantics.Variables; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.IR; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +namespace HydraScript.Application.StaticAnalysis; public interface ISymbolTableStorage { diff --git a/src/Application/HydraScript.Application.StaticAnalysis/ITypeDeclarationsResolver.cs b/src/Application/HydraScript.Application.StaticAnalysis/ITypeDeclarationsResolver.cs new file mode 100644 index 00000000..d7ac8ff2 --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/ITypeDeclarationsResolver.cs @@ -0,0 +1,10 @@ +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; + +namespace HydraScript.Application.StaticAnalysis; + +public interface ITypeDeclarationsResolver +{ + public void Store(TypeDeclaration declaration); + + public void Resolve(); +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.StaticAnalysis/Impl/ComputedTypesStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/ComputedTypesStorage.cs new file mode 100644 index 00000000..f38ff265 --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/ComputedTypesStorage.cs @@ -0,0 +1,16 @@ +namespace HydraScript.Application.StaticAnalysis.Impl; + +internal class ComputedTypesStorage : IComputedTypesStorage +{ + private readonly Dictionary _computedTypes = []; + + public Guid Save(Type computedType) + { + var guid = Guid.NewGuid(); + _computedTypes[guid] = computedType; + return guid; + } + + public Type Get(Guid computedTypeGuid) => + _computedTypes[computedTypeGuid]; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/DefaultValueForTypeCalculator.cs similarity index 79% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/DefaultValueForTypeCalculator.cs index 35ef3a80..c11624c7 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/DefaultValueForTypeCalculator.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/DefaultValueForTypeCalculator.cs @@ -1,8 +1,8 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator +internal class DefaultValueForTypeCalculator : IDefaultValueForTypeCalculator { private readonly Type _boolean = "boolean"; private readonly Type _number = "number"; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/FunctionWithUndefinedReturnStorage.cs similarity index 72% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/FunctionWithUndefinedReturnStorage.cs index 720a2f1c..4de6ff44 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/FunctionWithUndefinedReturnStorage.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/FunctionWithUndefinedReturnStorage.cs @@ -1,12 +1,12 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.IR.Impl.Symbols; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage +internal class FunctionWithUndefinedReturnStorage : IFunctionWithUndefinedReturnStorage { - private readonly Dictionary _declarations = new(); - private readonly Dictionary _keysWithOrder = new(); + private readonly Dictionary _declarations = []; + private readonly Dictionary _keysWithOrder = []; public void Save(FunctionSymbol symbol, FunctionDeclaration declaration) { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/JavaScriptTypesProvider.cs similarity index 62% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/JavaScriptTypesProvider.cs index 1b7e0a82..425a08a5 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/JavaScriptTypesProvider.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/JavaScriptTypesProvider.cs @@ -1,8 +1,8 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class JavaScriptTypesProvider : IJavaScriptTypesProvider +internal class JavaScriptTypesProvider : IJavaScriptTypesProvider { private readonly HashSet _types = [ diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/MethodStorage.cs similarity index 68% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/MethodStorage.cs index 2c04dc6f..7e480be8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/MethodStorage.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/MethodStorage.cs @@ -1,11 +1,11 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +using HydraScript.Domain.IR.Impl.Symbols; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class MethodStorage : IMethodStorage +internal class MethodStorage : IMethodStorage { - private readonly Dictionary> _bindings = new(); + private readonly Dictionary> _bindings = []; public void BindMethod(ObjectType objectType, FunctionSymbol method) { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/StandardLibraryProvider.cs similarity index 69% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/StandardLibraryProvider.cs index 2dee053b..68f0dd76 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/StandardLibraryProvider.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/StandardLibraryProvider.cs @@ -1,10 +1,10 @@ -using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +using HydraScript.Domain.IR; +using HydraScript.Domain.IR.Impl; +using HydraScript.Domain.IR.Impl.Symbols; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class StandardLibraryProvider : IStandardLibraryProvider +internal class StandardLibraryProvider : IStandardLibraryProvider { private readonly IJavaScriptTypesProvider _provider; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/SymbolTableStorage.cs similarity index 70% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/SymbolTableStorage.cs index b0409cd2..c46b841e 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/SymbolTableStorage.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/SymbolTableStorage.cs @@ -1,10 +1,10 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.IR; +using HydraScript.Domain.IR.Impl; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class SymbolTableStorage : ISymbolTableStorage +internal class SymbolTableStorage : ISymbolTableStorage { private readonly Dictionary _symbolTables = []; public ISymbolTable this[Scope scope] => _symbolTables[scope.Id]; diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs b/src/Application/HydraScript.Application.StaticAnalysis/Impl/TypeDeclarationsResolver.cs similarity index 82% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Impl/TypeDeclarationsResolver.cs index 5241764a..93a8a5f5 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/Impl/TypeDeclarationsResolver.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Impl/TypeDeclarationsResolver.cs @@ -1,22 +1,24 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.IR.Impl.Symbols; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +namespace HydraScript.Application.StaticAnalysis.Impl; -public class TypeDeclarationsResolver : ITypeDeclarationsResolver +internal class TypeDeclarationsResolver : ITypeDeclarationsResolver { - private readonly Queue _declarationsToResolve = new(); + private readonly Queue _declarationsToResolve = []; + private readonly IJavaScriptTypesProvider _provider; private readonly ISymbolTableStorage _symbolTables; private readonly IVisitor _typeBuilder; public TypeDeclarationsResolver( IJavaScriptTypesProvider provider, - ISymbolTableStorage symbolTables) + ISymbolTableStorage symbolTables, + IVisitor typeBuilder) { _provider = provider; _symbolTables = symbolTables; - _typeBuilder = new TypeBuilder(_symbolTables); + _typeBuilder = typeBuilder; } public void Store(TypeDeclaration declaration) => diff --git a/src/Application/HydraScript.Application.StaticAnalysis/ServiceCollectionExtensions.cs b/src/Application/HydraScript.Application.StaticAnalysis/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..7766aa4b --- /dev/null +++ b/src/Application/HydraScript.Application.StaticAnalysis/ServiceCollectionExtensions.cs @@ -0,0 +1,34 @@ +using HydraScript.Application.StaticAnalysis.Impl; +using HydraScript.Application.StaticAnalysis.Visitors; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using Microsoft.Extensions.DependencyInjection; + +namespace HydraScript.Application.StaticAnalysis; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddStaticAnalysis(this IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton, TypeBuilder>(); + + services.AddSingleton, SymbolTableInitializer>(); + services.AddSingleton, TypeSystemLoader>(); + services.AddSingleton, DeclarationVisitor>(); + + services.AddSingleton, SemanticChecker>(); + + return services; + } +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/DeclarationVisitor.cs similarity index 80% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Visitors/DeclarationVisitor.cs index 59c941f8..0b05d4e8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/DeclarationVisitor.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/DeclarationVisitor.cs @@ -1,16 +1,15 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +using HydraScript.Application.StaticAnalysis.Exceptions; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.IR.Impl.Symbols; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors; +namespace HydraScript.Application.StaticAnalysis.Visitors; -public class DeclarationVisitor : VisitorNoReturnBase, +internal class DeclarationVisitor : VisitorNoReturnBase, IVisitor, IVisitor { @@ -22,12 +21,13 @@ public class DeclarationVisitor : VisitorNoReturnBase, public DeclarationVisitor( IFunctionWithUndefinedReturnStorage functionStorage, IMethodStorage methodStorage, - ISymbolTableStorage symbolTables) + ISymbolTableStorage symbolTables, + IVisitor typeBuilder) { _functionStorage = functionStorage; _methodStorage = methodStorage; _symbolTables = symbolTables; - _typeBuilder = new TypeBuilder(_symbolTables); + _typeBuilder = typeBuilder; } public override VisitUnit Visit(IAbstractSyntaxTreeNode visitable) diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/SemanticChecker.cs similarity index 90% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Visitors/SemanticChecker.cs index 744915df..f8be762e 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SemanticChecker.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/SemanticChecker.cs @@ -1,21 +1,20 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors; - -public class SemanticChecker : VisitorBase, +using HydraScript.Application.StaticAnalysis.Exceptions; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; +using HydraScript.Domain.IR; +using HydraScript.Domain.IR.Impl.Symbols; +using HydraScript.Domain.IR.Types; + +namespace HydraScript.Application.StaticAnalysis.Visitors; + +internal class SemanticChecker : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -44,19 +43,23 @@ public class SemanticChecker : VisitorBase, private readonly IFunctionWithUndefinedReturnStorage _functionStorage; private readonly IMethodStorage _methodStorage; private readonly ISymbolTableStorage _symbolTables; + private readonly IComputedTypesStorage _computedTypes; private readonly IVisitor _typeBuilder; public SemanticChecker( IDefaultValueForTypeCalculator calculator, IFunctionWithUndefinedReturnStorage functionStorage, IMethodStorage methodStorage, - ISymbolTableStorage symbolTables) + ISymbolTableStorage symbolTables, + IComputedTypesStorage computedTypes, + IVisitor typeBuilder) { _calculator = calculator; _functionStorage = functionStorage; _methodStorage = methodStorage; _symbolTables = symbolTables; - _typeBuilder = new TypeBuilder(_symbolTables); + _computedTypes = computedTypes; + _typeBuilder = typeBuilder; } public override Type DefaultVisit => "undefined"; @@ -322,15 +325,16 @@ public Type Visit(AssignmentExpression visitable) public Type Visit(MemberExpression visitable) { var idType = visitable.Id.Accept(This); - visitable.ComputedIdType = idType; + visitable.ComputedIdTypeGuid = _computedTypes.Save(idType); return visitable.Empty() ? idType : visitable.AccessChain?.Accept(This) ?? "undefined"; } public Type Visit(IndexAccess visitable) { - var prevType = - visitable.Prev?.ComputedType - ?? (visitable.Parent as MemberExpression)!.ComputedIdType; + var prevTypeGuid = + visitable.Prev?.ComputedTypeGuid + ?? (visitable.Parent as MemberExpression)!.ComputedIdTypeGuid; + var prevType = _computedTypes.Get(prevTypeGuid); if (prevType is not ArrayType arrayType) throw new NonAccessibleType(prevType); @@ -341,15 +345,16 @@ public Type Visit(IndexAccess visitable) throw new ArrayAccessException(visitable.Segment, indexType); var elemType = arrayType.Type; - visitable.ComputedType = elemType; + visitable.ComputedTypeGuid = _computedTypes.Save(elemType); return visitable.HasNext() ? visitable.Next?.Accept(This) ?? "undefined" : elemType; } public Type Visit(DotAccess visitable) { - var prevType = - visitable.Prev?.ComputedType - ?? (visitable.Parent as MemberExpression)!.ComputedIdType; + var prevTypeGuid = + visitable.Prev?.ComputedTypeGuid + ?? (visitable.Parent as MemberExpression)!.ComputedIdTypeGuid; + var prevType = _computedTypes.Get(prevTypeGuid); if (prevType is not ObjectType objectType) throw new NonAccessibleType(prevType); @@ -360,7 +365,7 @@ public Type Visit(DotAccess visitable) return hasMethod ? objectType : throw new ObjectAccessException(visitable.Segment, objectType, visitable.Property); - visitable.ComputedType = fieldType; + visitable.ComputedTypeGuid = _computedTypes.Save(fieldType); return visitable.HasNext() ? visitable.Next?.Accept(This) ?? "undefined" : fieldType; } @@ -424,7 +429,7 @@ symbol as FunctionSymbol } Type @void = "void"; - if (functionReturnType.Equals(@void)) + if (!functionReturnType.Equals(@void)) visitable.HasReturnValue = true; return functionReturnType; } diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/SymbolTableInitializer.cs similarity index 77% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Visitors/SymbolTableInitializer.cs index 108f9d3c..7b75c558 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/SymbolTableInitializer.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/SymbolTableInitializer.cs @@ -1,13 +1,12 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; +using HydraScript.Domain.IR.Impl; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors; +namespace HydraScript.Application.StaticAnalysis.Visitors; -public class SymbolTableInitializer : VisitorNoReturnBase, +internal class SymbolTableInitializer : VisitorNoReturnBase, IVisitor, IVisitor, IVisitor diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeBuilder.cs similarity index 71% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeBuilder.cs index 6f93d351..71d1ae12 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeBuilder.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeBuilder.cs @@ -1,12 +1,11 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +using HydraScript.Application.StaticAnalysis.Exceptions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.IR.Impl.Symbols; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors; +namespace HydraScript.Application.StaticAnalysis.Visitors; -public class TypeBuilder : VisitorBase, +internal class TypeBuilder : VisitorBase, IVisitor, IVisitor, IVisitor, @@ -14,10 +13,8 @@ public class TypeBuilder : VisitorBase, { private readonly ISymbolTableStorage _symbolTables; - public TypeBuilder(ISymbolTableStorage symbolTables) - { + public TypeBuilder(ISymbolTableStorage symbolTables) => _symbolTables = symbolTables; - } public Type Visit(TypeIdentValue visitable) => _symbolTables[visitable.Scope].FindSymbol(visitable.TypeId)?.Type ?? diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeSystemLoader.cs similarity index 76% rename from src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs rename to src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeSystemLoader.cs index d5b0c2a0..8225e0fb 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/TypeSystemLoader.cs +++ b/src/Application/HydraScript.Application.StaticAnalysis/Visitors/TypeSystemLoader.cs @@ -1,13 +1,12 @@ -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; +using HydraScript.Application.StaticAnalysis.Exceptions; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.IR.Impl.Symbols; -namespace HydraScript.Lib.IR.CheckSemantics.Visitors; +namespace HydraScript.Application.StaticAnalysis.Visitors; -public class TypeSystemLoader : VisitorNoReturnBase, +internal class TypeSystemLoader : VisitorNoReturnBase, IVisitor, IVisitor { diff --git a/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs b/src/Domain/HydraScript.Domain.BackEnd/AddressedInstructions.cs similarity index 96% rename from src/HydraScript.Lib/BackEnd/AddressedInstructions.cs rename to src/Domain/HydraScript.Domain.BackEnd/AddressedInstructions.cs index 684594c5..7f74e907 100644 --- a/src/HydraScript.Lib/BackEnd/AddressedInstructions.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/AddressedInstructions.cs @@ -1,7 +1,7 @@ using System.Collections; -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public class AddressedInstructions : IEnumerable { diff --git a/src/HydraScript.Lib/BackEnd/Call.cs b/src/Domain/HydraScript.Domain.BackEnd/Call.cs similarity index 80% rename from src/HydraScript.Lib/BackEnd/Call.cs rename to src/Domain/HydraScript.Domain.BackEnd/Call.cs index 106bcfdd..c3cc4f61 100644 --- a/src/HydraScript.Lib/BackEnd/Call.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Call.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public record Call( IAddress From, diff --git a/src/HydraScript.Lib/BackEnd/Frame.cs b/src/Domain/HydraScript.Domain.BackEnd/Frame.cs similarity index 91% rename from src/HydraScript.Lib/BackEnd/Frame.cs rename to src/Domain/HydraScript.Domain.BackEnd/Frame.cs index d5e08427..e3e5d963 100644 --- a/src/HydraScript.Lib/BackEnd/Frame.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Frame.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public class Frame(IAddress returnAddress, Frame? parentFrame = null) { diff --git a/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj new file mode 100644 index 00000000..605e1abc --- /dev/null +++ b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj @@ -0,0 +1,10 @@ + + + + net8.0 + enable + enable + True + + + diff --git a/src/HydraScript.Lib/BackEnd/IAddress.cs b/src/Domain/HydraScript.Domain.BackEnd/IAddress.cs similarity index 69% rename from src/HydraScript.Lib/BackEnd/IAddress.cs rename to src/Domain/HydraScript.Domain.BackEnd/IAddress.cs index ea9006a2..27015987 100644 --- a/src/HydraScript.Lib/BackEnd/IAddress.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/IAddress.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public interface IAddress : IEquatable { diff --git a/src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs b/src/Domain/HydraScript.Domain.BackEnd/IExecutableInstruction.cs similarity index 82% rename from src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs rename to src/Domain/HydraScript.Domain.BackEnd/IExecutableInstruction.cs index 13cfb1f8..33af4ac3 100644 --- a/src/HydraScript.Lib/BackEnd/IExecutableInstruction.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/IExecutableInstruction.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public interface IExecutableInstruction { diff --git a/src/HydraScript.Lib/BackEnd/IExecuteParams.cs b/src/Domain/HydraScript.Domain.BackEnd/IExecuteParams.cs similarity index 84% rename from src/HydraScript.Lib/BackEnd/IExecuteParams.cs rename to src/Domain/HydraScript.Domain.BackEnd/IExecuteParams.cs index ecfe8ca4..347077da 100644 --- a/src/HydraScript.Lib/BackEnd/IExecuteParams.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/IExecuteParams.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public interface IExecuteParams { diff --git a/src/HydraScript.Lib/BackEnd/IValue.cs b/src/Domain/HydraScript.Domain.BackEnd/IValue.cs similarity index 67% rename from src/HydraScript.Lib/BackEnd/IValue.cs rename to src/Domain/HydraScript.Domain.BackEnd/IValue.cs index d08a9d88..847ebd44 100644 --- a/src/HydraScript.Lib/BackEnd/IValue.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/IValue.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public interface IValue : IEquatable { diff --git a/src/HydraScript.Lib/BackEnd/IVirtualMachine.cs b/src/Domain/HydraScript.Domain.BackEnd/IVirtualMachine.cs similarity index 79% rename from src/HydraScript.Lib/BackEnd/IVirtualMachine.cs rename to src/Domain/HydraScript.Domain.BackEnd/IVirtualMachine.cs index f247273b..e8263e32 100644 --- a/src/HydraScript.Lib/BackEnd/IVirtualMachine.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/IVirtualMachine.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd; +namespace HydraScript.Domain.BackEnd; public interface IVirtualMachine { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/HashAddress.cs similarity index 91% rename from src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/HashAddress.cs index 9dbde339..6b93034b 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Addresses/HashAddress.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/HashAddress.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Addresses; +namespace HydraScript.Domain.BackEnd.Impl.Addresses; public class HashAddress(int seed) : IAddress { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/Label.cs similarity index 87% rename from src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/Label.cs index 5622620e..0478a2c0 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Addresses/Label.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Addresses/Label.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Addresses; +namespace HydraScript.Domain.BackEnd.Impl.Addresses; public class Label(string name) : IAddress { diff --git a/src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/ExecuteParams.cs similarity index 86% rename from src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/ExecuteParams.cs index 619a70aa..4af9255c 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/ExecuteParams.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/ExecuteParams.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl; +namespace HydraScript.Domain.BackEnd.Impl; public class ExecuteParams(TextWriter textWriter) : IExecuteParams { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/BlockLabel.cs similarity index 94% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/BlockLabel.cs index efd7d66f..e3b2d08e 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/BlockLabel.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/BlockLabel.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public abstract class BlockLabel : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Halt.cs similarity index 73% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Halt.cs index 69d677e8..1d95af05 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Halt.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Halt.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class Halt : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Instruction.cs similarity index 91% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Instruction.cs index 6c785e80..2d7c38d2 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Instruction.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Instruction.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public abstract class Instruction : IExecutableInstruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PopParameter.cs similarity index 87% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PopParameter.cs index 037113dd..2212889d 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PopParameter.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PopParameter.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class PopParameter(string parameter) : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Print.cs similarity index 85% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Print.cs index 576e01d7..db11b1f0 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Print.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Print.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class Print(IValue value) : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PushParameter.cs similarity index 86% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PushParameter.cs index a790e160..3630ec1e 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/PushParameter.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/PushParameter.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class PushParameter(IValue value) : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/RemoveFromArray.cs similarity index 88% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/RemoveFromArray.cs index 6a42591d..b8e7a5ee 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/RemoveFromArray.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/RemoveFromArray.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class RemoveFromArray(string id, IValue index) : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Return.cs similarity index 90% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Return.cs index be8acfb6..a30abf38 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/Return.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/Return.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions; +namespace HydraScript.Domain.BackEnd.Impl.Instructions; public class Return(IValue? value = null) : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs similarity index 91% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs index 183ffe13..83e74294 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/AsString.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; public class AsString(IValue value) : Simple(value) { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs similarity index 90% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs index cbd540bd..2d7c5240 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/CallFunction.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; public class CallFunction( FunctionInfo function, diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs similarity index 81% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs index 756bb1ef..13f52c05 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateArray.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; public class CreateArray(string id, int size) : Simple(id) { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs similarity index 81% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs index c2647d2d..43cd2070 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Create/CreateObject.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; public class CreateObject(string id) : Simple(id) { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs similarity index 71% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs index 85dad652..4ca55d39 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/DotRead.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Domain.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; public class DotRead(Name @object, IValue property) : Simple( leftValue: @object, diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs similarity index 59% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs index 6ec8afbd..f5b6caf8 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IReadFromComplexData.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; public interface IReadFromComplexData { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs similarity index 67% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs index c87dda1e..af34e7db 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Read/IndexRead.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Domain.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; public class IndexRead(Name array, IValue index) : Simple( leftValue: array, diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs similarity index 76% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs index 2a6bd290..da535e00 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/DotAssignment.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Domain.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; public class DotAssignment(string @object, IValue property, IValue value) : Simple(left: @object, (property, value), "."), IWriteToComplexData diff --git a/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs new file mode 100644 index 00000000..0f35a250 --- /dev/null +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; + +public interface IWriteToComplexData +{ + Simple ToSimple(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs similarity index 75% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs index b3eae1a5..84520971 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IndexAssignment.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Read; +using HydraScript.Domain.BackEnd.Impl.Values; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; public class IndexAssignment(string array, IValue index, IValue value) : Simple(left: array, right: (index, value), "[]"), IWriteToComplexData diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/Simple.cs similarity index 97% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/Simple.cs index ad3cb042..0af2110e 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/Simple.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/Simple.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; public class Simple : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/Goto.cs similarity index 83% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/Goto.cs index bab94fc4..8a78c0c1 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/Goto.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/Goto.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; public class Goto : Instruction { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs similarity index 81% rename from src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs index baff1559..304834e3 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithJump/IfNotGoto.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; public class IfNotGoto : Goto { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Constant.cs similarity index 89% rename from src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Constant.cs index 3c3aef52..7d41e68f 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Values/Constant.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Constant.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Values; +namespace HydraScript.Domain.BackEnd.Impl.Values; public class Constant(object? value, string representation) : IValue { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Name.cs similarity index 84% rename from src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Name.cs index 61ebd705..0ce77de1 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/Values/Name.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Values/Name.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl.Values; +namespace HydraScript.Domain.BackEnd.Impl.Values; public class Name(string id) : IValue { diff --git a/src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/VirtualMachine.cs similarity index 93% rename from src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs rename to src/Domain/HydraScript.Domain.BackEnd/Impl/VirtualMachine.cs index 559e8a46..67a715ff 100644 --- a/src/HydraScript.Lib/BackEnd/Impl/VirtualMachine.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/VirtualMachine.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.BackEnd.Impl; +namespace HydraScript.Domain.BackEnd.Impl; public class VirtualMachine(TextWriter writer) : IVirtualMachine { diff --git a/src/Domain/HydraScript.Domain.FrontEnd/GlobalUsings.cs b/src/Domain/HydraScript.Domain.FrontEnd/GlobalUsings.cs new file mode 100644 index 00000000..8a66e1a7 --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/GlobalUsings.cs @@ -0,0 +1,4 @@ +// Global using directives + +global using Expression = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.Expression; +global using Visitor.NET; \ No newline at end of file diff --git a/src/HydraScript.Lib/HydraScript.Lib.csproj b/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj similarity index 50% rename from src/HydraScript.Lib/HydraScript.Lib.csproj rename to src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj index 0783a6a6..72fa726d 100644 --- a/src/HydraScript.Lib/HydraScript.Lib.csproj +++ b/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -8,12 +8,8 @@ - - - - - - + + diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs new file mode 100644 index 00000000..55d62136 --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Domain.FrontEnd.Lexer; + +public interface ILexer +{ + public Structure Structure { get; } + + public List GetTokens(string text); +} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITextCoordinateSystemComputer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITextCoordinateSystemComputer.cs new file mode 100644 index 00000000..b468922e --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITextCoordinateSystemComputer.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Domain.FrontEnd.Lexer; + +public interface ITextCoordinateSystemComputer +{ + public IReadOnlyList GetLines(string text); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs similarity index 86% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs index 6eca3419..b31b66d4 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/Lexer.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs @@ -1,11 +1,10 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; +namespace HydraScript.Domain.FrontEnd.Lexer.Impl; -public class Lexer(Structure structure, ITextCoordinateSystemComputer computer) : ILexer, IEnumerable +public class RegexLexer(Structure structure, ITextCoordinateSystemComputer computer) : ILexer, IEnumerable { private IReadOnlyList _lines = []; private string _text = ""; diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/TextCoordinateSystemComputer.cs similarity index 94% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/TextCoordinateSystemComputer.cs index 73423828..5aa435dc 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Impl/TextCoordinateSystemComputer.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/TextCoordinateSystemComputer.cs @@ -1,6 +1,6 @@ using System.Buffers; -namespace HydraScript.Lib.FrontEnd.GetTokens.Impl; +namespace HydraScript.Domain.FrontEnd.Lexer.Impl; public class TextCoordinateSystemComputer : ITextCoordinateSystemComputer { diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/LexerException.cs similarity index 81% rename from src/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/LexerException.cs index 28b42e20..215d2e8a 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/LexerException.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/LexerException.cs @@ -1,7 +1,6 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -namespace HydraScript.Lib.FrontEnd.GetTokens; +namespace HydraScript.Domain.FrontEnd.Lexer; [Serializable, ExcludeFromCodeCoverage] public class LexerException : Exception diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs similarity index 92% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs index 7e0a1b03..0b5fc4b0 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Structure.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs @@ -2,9 +2,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text; using System.Text.RegularExpressions; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -namespace HydraScript.Lib.FrontEnd.GetTokens.Data; +namespace HydraScript.Domain.FrontEnd.Lexer; public class Structure : IEnumerable { diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Token.cs similarity index 93% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/Token.cs index 3d007a73..b75eea2d 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/Token.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Token.cs @@ -1,8 +1,8 @@ using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -namespace HydraScript.Lib.FrontEnd.GetTokens.Data; +namespace HydraScript.Domain.FrontEnd.Lexer; [ExcludeFromCodeCoverage] public partial record Token(TokenType Type, Segment Segment, string Value) diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs similarity index 67% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs index a23c7a9d..616b8ca0 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/EndOfProgramType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; internal record EndOfProgramType() : TokenType("EOP", "", int.MaxValue - 1) { diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs similarity index 65% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs index d76f0128..90d28e9e 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/ErrorType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; internal record ErrorType() : TokenType("ERROR", @"\S+", int.MaxValue) { diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs similarity index 72% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs index 8df56f2e..89c0fb74 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/IgnorableType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; public record IgnorableType(string Tag, string Pattern, int Priority) : TokenType(Tag, Pattern, Priority) diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs similarity index 83% rename from src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs index 98e0ebfb..beeda930 100644 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/Data/TokenTypes/TokenType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; public record TokenType(string Tag, string Pattern, int Priority) { diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs new file mode 100644 index 00000000..3cc6ebc7 --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs @@ -0,0 +1,116 @@ +namespace HydraScript.Domain.FrontEnd.Lexer; + +public static class TokenTypesJson +{ + public const string String = + """ + [ + { + "tag": "Comment", + "pattern": "[\/]{2}.*", + "priority": 0, + "canIgnore": true + }, + { + "tag": "Ident", + "pattern": "[a-zA-Z][a-zA-Z0-9]*", + "priority": 50 + }, + { + "tag": "IntegerLiteral", + "pattern": "[0-9]+", + "priority": 3 + }, + { + "tag": "FloatLiteral", + "pattern": "[0-9]+[.][0-9]+", + "priority": 2 + }, + { + "tag": "NullLiteral", + "pattern": "null", + "priority": 4 + }, + { + "tag": "BooleanLiteral", + "pattern": "true|false", + "priority": 5 + }, + { + "tag": "StringLiteral", + "pattern": "\\\"(\\\\.|[^\"\\\\])*\\\"", + "priority": 6 + }, + { + "tag": "Keyword", + "pattern": "let|const|function|if|else|while|break|continue|return|as|type", + "priority": 11 + }, + { + "tag": "Operator", + "pattern": "[+]{1,2}|[-]|[*]|[\/]|[%]|([!]|[=])[=]|([<]|[>])[=]?|[!]|[|]{2}|[&]{2}|[~]|[:]{2}", + "priority": 12 + }, + { + "tag": "Comma", + "pattern": "[,]", + "priority": 100 + }, + { + "tag": "Dot", + "pattern": "[.]", + "priority": 105 + }, + { + "tag": "LeftCurl", + "pattern": "[{]", + "priority": 101 + }, + { + "tag": "RightCurl", + "pattern": "[}]", + "priority": 102 + }, + { + "tag": "LeftParen", + "pattern": "[(]", + "priority": 103 + }, + { + "tag": "RightParen", + "pattern": "[)]", + "priority": 104 + }, + { + "tag": "LeftBracket", + "pattern": "[[]", + "priority": 107 + }, + { + "tag": "RightBracket", + "pattern": "[]]", + "priority": 109 + }, + { + "tag": "Assign", + "pattern": "[=]", + "priority": 99 + }, + { + "tag": "QuestionMark", + "pattern": "[?]", + "priority": 90 + }, + { + "tag": "Colon", + "pattern": "[:]", + "priority": 91 + }, + { + "tag": "SemiColon", + "pattern": "[;]", + "priority": 92 + } + ] + """; +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTree.cs similarity index 66% rename from src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTree.cs index d29b3fef..ce4f6a98 100644 --- a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTree.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTree.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast; +namespace HydraScript.Domain.FrontEnd.Parser; public interface IAbstractSyntaxTree { diff --git a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTreeNode.cs similarity index 87% rename from src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTreeNode.cs index 5de9cab2..ee59c67a 100644 --- a/src/HydraScript.Lib/IR/Ast/IAbstractSyntaxTreeNode.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IAbstractSyntaxTreeNode.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast; +namespace HydraScript.Domain.FrontEnd.Parser; public interface IAbstractSyntaxTreeNode : IReadOnlyList, diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Parser/IParser.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IParser.cs new file mode 100644 index 00000000..03d6c36c --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/IParser.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Domain.FrontEnd.Parser; + +public interface IParser +{ + public IAbstractSyntaxTree Parse(string text); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTree.cs similarity index 92% rename from src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTree.cs index a0f3a07b..d4825d53 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTree.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTree.cs @@ -1,6 +1,6 @@ using System.Text; -namespace HydraScript.Lib.IR.Ast.Impl; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast; internal class AbstractSyntaxTree(IAbstractSyntaxTreeNode root) : IAbstractSyntaxTree { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTreeNode.cs similarity index 97% rename from src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTreeNode.cs index a62e5e61..dbfa573c 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/AbstractSyntaxTreeNode.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/AbstractSyntaxTreeNode.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace HydraScript.Lib.IR.Ast.Impl; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast; public abstract class AbstractSyntaxTreeNode : IAbstractSyntaxTreeNode { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs similarity index 66% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs index e603b490..11b6b0e7 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/AfterTypesAreLoadedDeclaration.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; public abstract class AfterTypesAreLoadedDeclaration : Declaration { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs similarity index 87% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs index c644b3fd..3625aa0c 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/FunctionDeclaration.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; [AutoVisitable] public partial class FunctionDeclaration : AfterTypesAreLoadedDeclaration diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs similarity index 80% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs index 3adb8ed1..bd0c65d0 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/AfterTypesAreLoaded/LexicalDeclaration.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; [AutoVisitable] public partial class LexicalDeclaration(bool readOnly) : AfterTypesAreLoadedDeclaration diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeDeclaration.cs similarity index 77% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeDeclaration.cs index 3fcbe51a..e4c7cbfb 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeDeclaration.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeDeclaration.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; [AutoVisitable] public partial class TypeDeclaration(IdentifierReference typeId, TypeValue typeValue) : Declaration diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeValue.cs similarity index 86% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeValue.cs index 2352c724..084e1ff4 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Declarations/TypeValue.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Declarations/TypeValue.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; public abstract record TypeValue : IVisitable { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs similarity index 79% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs index 2a6e112b..bb7d9289 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/AccessExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/AccessExpression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; public abstract class AccessExpression : Expression { @@ -7,7 +7,7 @@ public abstract class AccessExpression : Expression public AccessExpression? Prev => Parent as AccessExpression; - public Type ComputedType { get; set; } = default!; + public Guid ComputedTypeGuid { get; set; } = Guid.Empty; protected AccessExpression(AccessExpression? prev) { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs similarity index 73% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs index 99c3833a..663c0555 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/DotAccess.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/DotAccess.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; [AutoVisitable] public partial class DotAccess : AccessExpression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs similarity index 83% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs index c71ec0c6..633dd27c 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AccessExpressions/IndexAccess.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AccessExpressions/IndexAccess.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; [AutoVisitable] public partial class IndexAccess : AccessExpression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AssignmentExpression.cs similarity index 87% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AssignmentExpression.cs index 9d48e1eb..5a3e28ad 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/AssignmentExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/AssignmentExpression.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class AssignmentExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/BinaryExpression.cs similarity index 89% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/BinaryExpression.cs index fc65d5f7..bad0b5cc 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/BinaryExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/BinaryExpression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class BinaryExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CallExpression.cs similarity index 84% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CallExpression.cs index 48610acf..41c98e39 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CallExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CallExpression.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class CallExpression : LeftHandSideExpression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CastAsExpression.cs similarity index 83% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CastAsExpression.cs index ba5b356f..1fa87282 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/CastAsExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/CastAsExpression.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class CastAsExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs similarity index 86% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs index 0a0db176..7c84dc78 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ArrayLiteral.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class ArrayLiteral : ComplexLiteral diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs similarity index 67% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs index df889c41..47f00aea 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ComplexLiteral.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; public abstract class ComplexLiteral : Expression { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs similarity index 86% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs index 279e21cc..f8d01ea6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/ObjectLiteral.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class ObjectLiteral : ComplexLiteral diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/Property.cs similarity index 80% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/Property.cs index fd4968be..1336aa36 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ComplexLiterals/Property.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ComplexLiterals/Property.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; [AutoVisitable] public partial class Property : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ConditionalExpression.cs similarity index 90% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ConditionalExpression.cs index 589e8417..090511ad 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/ConditionalExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/ConditionalExpression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class ConditionalExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/Expression.cs similarity index 70% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/Expression.cs index 3883921d..a3766257 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/Expression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/Expression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; public abstract class Expression : AbstractSyntaxTreeNode { diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/LeftHandSideExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/LeftHandSideExpression.cs new file mode 100644 index 00000000..f15d9497 --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/LeftHandSideExpression.cs @@ -0,0 +1,10 @@ +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; + +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; + +public abstract class LeftHandSideExpression : Expression +{ + public abstract IdentifierReference Id { get; } + + public abstract bool Empty(); +} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/MemberExpression.cs similarity index 78% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/MemberExpression.cs index e8baa36b..33efd8e8 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/MemberExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/MemberExpression.cs @@ -1,7 +1,7 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class MemberExpression : LeftHandSideExpression @@ -14,7 +14,7 @@ public partial class MemberExpression : LeftHandSideExpression public AccessExpression? AccessChain { get; } public AccessExpression? Tail { get; } - public Type ComputedIdType { get; set; } = default!; + public Guid ComputedIdTypeGuid { get; set; } = Guid.Empty; public MemberExpression(IdentifierReference identifierReference) { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs similarity index 66% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs index 9d70c5ab..8396b932 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/AbstractLiteral.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; public abstract class AbstractLiteral(TypeValue type) : PrimaryExpression { diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs similarity index 82% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs index 26bc3690..407577f6 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/IdentifierReference.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; [AutoVisitable] public partial class IdentifierReference(string name) : PrimaryExpression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs similarity index 75% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs index caca3143..21392f46 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ImplicitLiteral.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; [AutoVisitable] public partial class ImplicitLiteral(TypeValue type) : AbstractLiteral(type) diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs similarity index 77% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs index 6162dc99..1a1d17f2 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/Literal.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/Literal.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; [AutoVisitable] public partial class Literal : AbstractLiteral diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs similarity index 61% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs index ceb4f229..b0b68107 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/PrimaryExpression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; [AutoVisitable] public abstract partial class PrimaryExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ValueDto.cs similarity index 81% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ValueDto.cs index d66c0661..bd310884 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/PrimaryExpressions/ValueDto.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/PrimaryExpressions/ValueDto.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; public record ValueDto( ValueDtoType Type, diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/UnaryExpression.cs similarity index 87% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/UnaryExpression.cs index 2e59e417..61f7222a 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/UnaryExpression.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Expressions/UnaryExpression.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; [AutoVisitable] public partial class UnaryExpression : Expression diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/ScriptBody.cs similarity index 93% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/ScriptBody.cs index 610daee0..8f1642b1 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/ScriptBody.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/ScriptBody.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; [AutoVisitable] public partial class ScriptBody : AbstractSyntaxTreeNode diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/StatementListItem.cs similarity index 75% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/StatementListItem.cs index dca2d3d4..e48633da 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/StatementListItem.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/StatementListItem.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; public abstract class StatementListItem : AbstractSyntaxTreeNode; diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/BlockStatement.cs similarity index 92% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/BlockStatement.cs index 2c4979e3..e063c23f 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/BlockStatement.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/BlockStatement.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class BlockStatement : Statement diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ExpressionStatement.cs similarity index 86% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ExpressionStatement.cs index abedd82b..cdd3759d 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ExpressionStatement.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ExpressionStatement.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class ExpressionStatement : Statement diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/IfStatement.cs similarity index 92% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/IfStatement.cs index 499dcaf0..74b19482 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/IfStatement.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/IfStatement.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class IfStatement : Statement diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/InsideStatementJump.cs similarity index 81% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/InsideStatementJump.cs index d1e397e7..3ee4e38c 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/InsideStatementJump.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/InsideStatementJump.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class InsideStatementJump(string keyword) : Statement diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ReturnStatement.cs similarity index 87% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ReturnStatement.cs index 5447dc76..3b8e6485 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/ReturnStatement.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/ReturnStatement.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class ReturnStatement : Statement diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/WhileStatement.cs similarity index 88% rename from src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/WhileStatement.cs index fc0de4e9..2b052ffe 100644 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Statements/WhileStatement.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/Ast/Nodes/Statements/WhileStatement.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +namespace HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; [AutoVisitable] public partial class WhileStatement : Statement diff --git a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TokensStream.cs similarity index 85% rename from src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TokensStream.cs index 40ce2af1..a258c818 100644 --- a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/TokensStream.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TokensStream.cs @@ -1,7 +1,7 @@ using System.Collections; -using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Domain.FrontEnd.Lexer; -namespace HydraScript.Lib.FrontEnd.TopDownParse.Impl; +namespace HydraScript.Domain.FrontEnd.Parser.Impl; public class TokensStream : IEnumerator { diff --git a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs similarity index 96% rename from src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs index 14e9e840..06f66457 100644 --- a/src/HydraScript.Lib/FrontEnd/TopDownParse/Impl/Parser.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs @@ -1,29 +1,27 @@ using System.Globalization; using System.Text.RegularExpressions; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Impl; -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.AccessExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.ComplexLiterals; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; - -namespace HydraScript.Lib.FrontEnd.TopDownParse.Impl; - -public class Parser : IParser +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.AccessExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.ComplexLiterals; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements; + +namespace HydraScript.Domain.FrontEnd.Parser.Impl; + +public class TopDownParser : IParser { private TokensStream _tokens = new List(); private readonly ILexer _lexer; - public Parser(ILexer lexer) => + public TopDownParser(ILexer lexer) => _lexer = lexer; - public IAbstractSyntaxTree TopDownParse(string text) + public IAbstractSyntaxTree Parse(string text) { _tokens = _lexer.GetTokens(text); diff --git a/src/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/ParserException.cs similarity index 84% rename from src/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/ParserException.cs index f4ba922f..995dbf2d 100644 --- a/src/HydraScript.Lib/FrontEnd/TopDownParse/ParserException.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/ParserException.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using HydraScript.Lib.FrontEnd.GetTokens.Data; +using HydraScript.Domain.FrontEnd.Lexer; -namespace HydraScript.Lib.FrontEnd.TopDownParse; +namespace HydraScript.Domain.FrontEnd.Parser; [Serializable, ExcludeFromCodeCoverage] public class ParserException : Exception diff --git a/src/HydraScript.Lib/IR/Ast/Scope.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Scope.cs similarity index 84% rename from src/HydraScript.Lib/IR/Ast/Scope.cs rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/Scope.cs index bae7b036..86e00d17 100644 --- a/src/HydraScript.Lib/IR/Ast/Scope.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Scope.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.Ast; +namespace HydraScript.Domain.FrontEnd.Parser; public record Scope { diff --git a/src/Domain/HydraScript.Domain.IR/GlobalUsings.cs b/src/Domain/HydraScript.Domain.IR/GlobalUsings.cs new file mode 100644 index 00000000..4f90012f --- /dev/null +++ b/src/Domain/HydraScript.Domain.IR/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Type = HydraScript.Domain.IR.Types.Type; \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj b/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj new file mode 100644 index 00000000..605e1abc --- /dev/null +++ b/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj @@ -0,0 +1,10 @@ + + + + net8.0 + enable + enable + True + + + diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs b/src/Domain/HydraScript.Domain.IR/ISymbol.cs similarity index 61% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs rename to src/Domain/HydraScript.Domain.IR/ISymbol.cs index 4b2db159..9af22f65 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbol.cs +++ b/src/Domain/HydraScript.Domain.IR/ISymbol.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables; +namespace HydraScript.Domain.IR; public interface ISymbol { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs b/src/Domain/HydraScript.Domain.IR/ISymbolTable.cs similarity index 95% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs rename to src/Domain/HydraScript.Domain.IR/ISymbolTable.cs index 5e0a8a7f..bc5d5811 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/ISymbolTable.cs +++ b/src/Domain/HydraScript.Domain.IR/ISymbolTable.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables; +namespace HydraScript.Domain.IR; public interface ISymbolTable { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs b/src/Domain/HydraScript.Domain.IR/Impl/SymbolTable.cs similarity index 94% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs rename to src/Domain/HydraScript.Domain.IR/Impl/SymbolTable.cs index af554a39..9dfdfab4 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/SymbolTable.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/SymbolTable.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl; +namespace HydraScript.Domain.IR.Impl; public class SymbolTable : ISymbolTable { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/FunctionSymbol.cs similarity index 91% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs rename to src/Domain/HydraScript.Domain.IR/Impl/Symbols/FunctionSymbol.cs index 3a3475cf..9b452870 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/FunctionSymbol.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/FunctionSymbol.cs @@ -1,6 +1,6 @@ using System.Text; -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +namespace HydraScript.Domain.IR.Impl.Symbols; public class FunctionSymbol( string id, diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/ObjectSymbol.cs similarity index 63% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs rename to src/Domain/HydraScript.Domain.IR/Impl/Symbols/ObjectSymbol.cs index d2bdce52..5a4bcf9b 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/ObjectSymbol.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/ObjectSymbol.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Domain.IR.Types; -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +namespace HydraScript.Domain.IR.Impl.Symbols; public class ObjectSymbol( string id, diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/Symbol.cs similarity index 69% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs rename to src/Domain/HydraScript.Domain.IR/Impl/Symbols/Symbol.cs index ebf42557..cf793acc 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/Symbol.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/Symbol.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +namespace HydraScript.Domain.IR.Impl.Symbols; public abstract class Symbol(string id, Type type) : ISymbol { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/TypeSymbol.cs similarity index 85% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs rename to src/Domain/HydraScript.Domain.IR/Impl/Symbols/TypeSymbol.cs index 0fbf9869..c3fda2a8 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/TypeSymbol.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/TypeSymbol.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +namespace HydraScript.Domain.IR.Impl.Symbols; public class TypeSymbol(Type type, string? id = null) : Symbol(id ?? type.ToString(), type) diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/VariableSymbol.cs similarity index 78% rename from src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs rename to src/Domain/HydraScript.Domain.IR/Impl/Symbols/VariableSymbol.cs index 6af2e704..dc93ad5d 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Variables/Impl/Symbols/VariableSymbol.cs +++ b/src/Domain/HydraScript.Domain.IR/Impl/Symbols/VariableSymbol.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; +namespace HydraScript.Domain.IR.Impl.Symbols; public class VariableSymbol( string id, diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs b/src/Domain/HydraScript.Domain.IR/Types/Any.cs similarity index 75% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs rename to src/Domain/HydraScript.Domain.IR/Types/Any.cs index 2d0de4f3..7ff16012 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/Any.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/Any.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class Any() : Type("any") { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs b/src/Domain/HydraScript.Domain.IR/Types/ArrayType.cs similarity index 93% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs rename to src/Domain/HydraScript.Domain.IR/Types/ArrayType.cs index 433bddb0..791b9c9f 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/ArrayType.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/ArrayType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class ArrayType(Type type) : Type($"{type}[]") { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs b/src/Domain/HydraScript.Domain.IR/Types/NullType.cs similarity index 80% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs rename to src/Domain/HydraScript.Domain.IR/Types/NullType.cs index 45ddddc5..4dcccefd 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/NullType.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/NullType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class NullType() : Type("null") { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs b/src/Domain/HydraScript.Domain.IR/Types/NullableType.cs similarity index 94% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs rename to src/Domain/HydraScript.Domain.IR/Types/NullableType.cs index 4d1cab73..e88383d7 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/NullableType.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/NullableType.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class NullableType : Type { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs b/src/Domain/HydraScript.Domain.IR/Types/ObjectType.cs similarity index 99% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs rename to src/Domain/HydraScript.Domain.IR/Types/ObjectType.cs index 3daf72e2..0080c27f 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/ObjectType.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/ObjectType.cs @@ -1,6 +1,6 @@ using System.Text; -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class ObjectType : NullableType { diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs b/src/Domain/HydraScript.Domain.IR/Types/Type.cs similarity index 94% rename from src/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs rename to src/Domain/HydraScript.Domain.IR/Types/Type.cs index a91ea5aa..26b33b42 100644 --- a/src/HydraScript.Lib/IR/CheckSemantics/Types/Type.cs +++ b/src/Domain/HydraScript.Domain.IR/Types/Type.cs @@ -1,4 +1,4 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Types; +namespace HydraScript.Domain.IR.Types; public class Type { diff --git a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs b/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs deleted file mode 100644 index 2a007f8f..00000000 --- a/src/HydraScript.Lib/BackEnd/Impl/Instructions/WithAssignment/ComplexData/Write/IWriteToComplexData.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; - -public interface IWriteToComplexData -{ - Simple ToSimple(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs deleted file mode 100644 index eef28abe..00000000 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/ILexer.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HydraScript.Lib.FrontEnd.GetTokens.Data; - -namespace HydraScript.Lib.FrontEnd.GetTokens; - -public interface ILexer -{ - Structure Structure { get; } - - List GetTokens(string text); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs b/src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs deleted file mode 100644 index 0d6bfbaa..00000000 --- a/src/HydraScript.Lib/FrontEnd/GetTokens/ITextCoordinateSystemComputer.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace HydraScript.Lib.FrontEnd.GetTokens; - -public interface ITextCoordinateSystemComputer -{ - IReadOnlyList GetLines(string text); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs b/src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs deleted file mode 100644 index 261ba4d0..00000000 --- a/src/HydraScript.Lib/FrontEnd/TopDownParse/IParser.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Lib.FrontEnd.TopDownParse; - -public interface IParser -{ - IAbstractSyntaxTree TopDownParse(string text); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/GlobalUsings.cs b/src/HydraScript.Lib/GlobalUsings.cs deleted file mode 100644 index bb877fed..00000000 --- a/src/HydraScript.Lib/GlobalUsings.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Global using directives - -global using Expression = HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.Expression; -global using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; -global using Visitor.NET; \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs b/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs deleted file mode 100644 index b5d289b2..00000000 --- a/src/HydraScript.Lib/IR/Ast/Impl/Nodes/Expressions/LeftHandSideExpression.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; - -namespace HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions; - -public abstract class LeftHandSideExpression : Expression -{ - public abstract IdentifierReference Id { get; } - - public abstract bool Empty(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs b/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs deleted file mode 100644 index c9eebb21..00000000 --- a/src/HydraScript.Lib/IR/Ast/Visitors/Services/IValueDtoConverter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; - -namespace HydraScript.Lib.IR.Ast.Visitors.Services; - -public interface IValueDtoConverter -{ - IValue Convert(ValueDto dto); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs deleted file mode 100644 index 739b26f3..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IFunctionWithUndefinedReturnStorage.cs +++ /dev/null @@ -1,15 +0,0 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface IFunctionWithUndefinedReturnStorage -{ - void Save(FunctionSymbol symbol, FunctionDeclaration declaration); - - FunctionDeclaration Get(FunctionSymbol symbol); - - void RemoveIfPresent(FunctionSymbol symbol); - - IEnumerable Flush(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs deleted file mode 100644 index 1af6123b..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IJavaScriptTypesProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface IJavaScriptTypesProvider -{ - IEnumerable GetDefaultTypes(); - - bool Contains(Type type); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs deleted file mode 100644 index 6f5a9de1..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IMethodStorage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface IMethodStorage -{ - void BindMethod(ObjectType objectType, FunctionSymbol method); - - IReadOnlyDictionary GetAvailableMethods(ObjectType objectType); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs deleted file mode 100644 index 984c2593..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/IStandardLibraryProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.IR.CheckSemantics.Variables; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface IStandardLibraryProvider -{ - ISymbolTable GetStandardLibrary(); -} \ No newline at end of file diff --git a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs b/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs deleted file mode 100644 index 8576b169..00000000 --- a/src/HydraScript.Lib/IR/CheckSemantics/Visitors/Services/ITypeDeclarationsResolver.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; - -namespace HydraScript.Lib.IR.CheckSemantics.Visitors.Services; - -public interface ITypeDeclarationsResolver -{ - void Store(TypeDeclaration declaration); - - void Resolve(); -} \ No newline at end of file diff --git a/src/HydraScript/CommandLineSettings.cs b/src/HydraScript/CommandLineSettings.cs deleted file mode 100644 index 87022f86..00000000 --- a/src/HydraScript/CommandLineSettings.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using CommandLine; -using CommandLine.Text; - -namespace HydraScript; - -[SuppressMessage("ReSharper", "UnusedMember.Global")] -[SuppressMessage("ReSharper", "PropertyCanBeMadeInitOnly.Global")] -[ExcludeFromCodeCoverage] -// ReSharper disable once ClassWithVirtualMembersNeverInherited.Global -public class CommandLineSettings -{ - [Value(0, MetaName = "InputFilePath", Required = true, HelpText = "Path to input file")] - public required string InputFilePath { get; set; } - - [Option('d', "dump", Default = false, HelpText = "Show dump data of interpreter")] - public bool Dump { get; set; } - - [Usage(ApplicationAlias = "HydraScript")] - public static IEnumerable Examples - { - get - { - yield return new Example("Simple interpretation call", - new CommandLineSettings { InputFilePath = "file.js" }); - yield return new Example("Request dump", - new CommandLineSettings { InputFilePath = "file.js", Dump = true }); - } - } -} \ No newline at end of file diff --git a/src/HydraScript/ExecuteCommand.cs b/src/HydraScript/ExecuteCommand.cs new file mode 100644 index 00000000..343a7355 --- /dev/null +++ b/src/HydraScript/ExecuteCommand.cs @@ -0,0 +1,23 @@ +using System.CommandLine; + +namespace HydraScript; + +public class ExecuteCommand : RootCommand +{ + public ExecuteCommand() : base("HydraScript interpreter") + { + PathArgument = new Argument( + name: "path", + description: "Path to input file"); + AddArgument(PathArgument); + + DumpOption = new Option( + ["-d", "--dump"], + getDefaultValue: () => false, + description: "Show dump data of interpreter"); + AddOption(DumpOption); + } + + public Argument PathArgument { get; } + public Option DumpOption { get; } +} \ No newline at end of file diff --git a/src/HydraScript/ExecuteCommandHandler.cs b/src/HydraScript/ExecuteCommandHandler.cs new file mode 100644 index 00000000..4e7b691f --- /dev/null +++ b/src/HydraScript/ExecuteCommandHandler.cs @@ -0,0 +1,45 @@ +using System.CommandLine.Invocation; +using HydraScript.Application.CodeGeneration; +using HydraScript.Application.StaticAnalysis.Exceptions; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Infrastructure; + +namespace HydraScript; + +internal class ExecuteCommandHandler( + ISourceCodeProvider sourceCodeProvider, + IParser parser, + ICodeGenerator codeGenerator, + IVirtualMachine virtualMachine, + TextWriter writer) : ICommandHandler +{ + + public int Invoke(InvocationContext context) + { + try + { + var sourceCode = sourceCodeProvider.GetText(); + var ast = parser.Parse(sourceCode); + var instructions = codeGenerator.GetInstructions(ast); + virtualMachine.Run(instructions); + return 0; + } + catch (Exception ex) + when (ex is LexerException or ParserException or SemanticException) + { + writer.WriteLine(ex.Message); + return 1; + } + catch (Exception ex) + { + writer.WriteLine("Internal HydraScript Error"); + writer.WriteLine(ex); + return 2; + } + } + + public Task InvokeAsync(InvocationContext context) => + Task.FromResult(Invoke(context)); +} \ No newline at end of file diff --git a/src/HydraScript/HydraScript.csproj b/src/HydraScript/HydraScript.csproj index db5fd8de..b17edf89 100644 --- a/src/HydraScript/HydraScript.csproj +++ b/src/HydraScript/HydraScript.csproj @@ -10,14 +10,16 @@ - + - - - - + + + + + + diff --git a/src/HydraScript/Program.cs b/src/HydraScript/Program.cs index 685fb75e..e6db4db8 100644 --- a/src/HydraScript/Program.cs +++ b/src/HydraScript/Program.cs @@ -1,60 +1,36 @@ -using System.Diagnostics.CodeAnalysis; -using System.IO.Abstractions; -using CommandLine; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Impl; -using HydraScript.Services.CodeGen; -using HydraScript.Services.CodeGen.Impl; -using HydraScript.Services.Executor; -using HydraScript.Services.Executor.Impl; -using HydraScript.Services.Parsing; -using HydraScript.Services.Parsing.Impl; -using HydraScript.Services.Providers.LexerProvider; -using HydraScript.Services.Providers.LexerProvider.Impl; -using HydraScript.Services.Providers.ParserProvider; -using HydraScript.Services.Providers.ParserProvider.Impl; -using HydraScript.Services.Providers.StructureProvider; -using HydraScript.Services.Providers.StructureProvider.Impl; -using HydraScript.Services.SourceCode; -using HydraScript.Services.SourceCode.Impl; +using System.CommandLine.Builder; +using System.CommandLine.Hosting; +using System.CommandLine.Parsing; +using HydraScript; +using HydraScript.Infrastructure; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; -namespace HydraScript; +GetRunner(ConfigureHost).Invoke(args); -[ExcludeFromCodeCoverage] -public static class Program +public static partial class Program { - private static IServiceCollection ServiceCollection { get; } = new ServiceCollection(); - private static IServiceProvider? ServiceProvider { get; set; } + public static readonly ExecuteCommand Command = new(); - private static void Main(string[] args) => - Parser.Default.ParseArguments(args) - .WithParsed(options => - { - ConfigureServices(options); - ServiceProvider? - .GetService()! - .Execute(); - }) - .WithNotParsed(errors => errors.Output()); - + public static Parser GetRunner(Action configureHost) => + new CommandLineBuilder(Command) + .UseHost(Host.CreateDefaultBuilder, configureHost) + .UseHelp() + .Build(); - private static void ConfigureServices(CommandLineSettings settings) - { - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - ServiceCollection.AddSingleton(); - - ServiceCollection.AddSingleton(); - - ServiceCollection.AddSingleton(_ => Options.Create(settings)); - - ServiceProvider = ServiceCollection.BuildServiceProvider(); - } + private static void ConfigureHost(IHostBuilder builder) => builder + .ConfigureServices((context, services) => + { + services.AddLogging(c => c.ClearProviders()); + var parseResult = context.GetInvocationContext().ParseResult; + var fileInfo = parseResult.GetValueForArgument(Command.PathArgument); + var dump = parseResult.GetValueForOption(Command.DumpOption); + services + .AddDomain() + .AddApplication() + .AddInfrastructure(dump, fileInfo); + }) + .UseDefaultServiceProvider((_, options) => options.ValidateScopes = true) + .UseCommandHandler(); } \ No newline at end of file diff --git a/src/HydraScript/Services/CodeGen/ICodeGenService.cs b/src/HydraScript/Services/CodeGen/ICodeGenService.cs deleted file mode 100644 index 1086f1f2..00000000 --- a/src/HydraScript/Services/CodeGen/ICodeGenService.cs +++ /dev/null @@ -1,9 +0,0 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Services.CodeGen; - -public interface ICodeGenService -{ - AddressedInstructions GetInstructions(IAbstractSyntaxTree ast); -} \ No newline at end of file diff --git a/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs b/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs deleted file mode 100644 index d36fa832..00000000 --- a/src/HydraScript/Services/CodeGen/Impl/CodeGenService.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.IR.Ast; -using HydraScript.Lib.IR.Ast.Visitors; -using HydraScript.Lib.IR.Ast.Visitors.Services.Impl; -using HydraScript.Lib.IR.CheckSemantics.Visitors; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; -using Microsoft.Extensions.Options; -using Visitor.NET; -using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; - -namespace HydraScript.Services.CodeGen.Impl; - -internal class CodeGenService : ICodeGenService -{ - private readonly IVisitor _symbolTableInitializer; - private readonly IVisitor _typeSystemLoader; - private readonly IVisitor _declarationVisitor; - - private readonly IVisitor _semanticChecker; - private readonly IVisitor _instructionProvider; - - private readonly IFileSystem _fileSystem; - private readonly CommandLineSettings _settings; - - public CodeGenService(IFileSystem fileSystem, IOptions options) - { - _fileSystem = fileSystem; - _settings = options.Value; - - var functionStorage = new FunctionWithUndefinedReturnStorage(); - var methodStorage = new MethodStorage(); - var symbolTables = new SymbolTableStorage(); - - _symbolTableInitializer = new SymbolTableInitializer( - new StandardLibraryProvider( - new JavaScriptTypesProvider()), - symbolTables); - _typeSystemLoader = new TypeSystemLoader( - new TypeDeclarationsResolver( - new JavaScriptTypesProvider(), - symbolTables), - new JavaScriptTypesProvider(), - symbolTables); - _declarationVisitor = new DeclarationVisitor(functionStorage, methodStorage, symbolTables); - - _semanticChecker = new SemanticChecker( - new DefaultValueForTypeCalculator(), - functionStorage, - methodStorage, - symbolTables); - _instructionProvider = new InstructionProvider(new ValueDtoConverter()); - } - - public AddressedInstructions GetInstructions(IAbstractSyntaxTree ast) - { - var root = ast.Root; - root.Accept(_symbolTableInitializer); - root.Accept(_typeSystemLoader); - root.Accept(_declarationVisitor); - - root.Accept(_semanticChecker); - var instructions = root.Accept(_instructionProvider); - - if (_settings.Dump) - { - var fileName = _settings.InputFilePath.Split(".js")[0]; - _fileSystem.File.WriteAllLines( - $"{fileName}.tac", - instructions.Select(i => i.ToString()!)); - } - - return instructions; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Executor/IExecutor.cs b/src/HydraScript/Services/Executor/IExecutor.cs deleted file mode 100644 index bc9711ed..00000000 --- a/src/HydraScript/Services/Executor/IExecutor.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace HydraScript.Services.Executor; - -public interface IExecutor -{ - void Execute(); -} \ No newline at end of file diff --git a/src/HydraScript/Services/Executor/Impl/Executor.cs b/src/HydraScript/Services/Executor/Impl/Executor.cs deleted file mode 100644 index 233f6fba..00000000 --- a/src/HydraScript/Services/Executor/Impl/Executor.cs +++ /dev/null @@ -1,50 +0,0 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Services.Parsing; -using HydraScript.Lib.BackEnd.Impl; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.IR.CheckSemantics.Exceptions; -using HydraScript.Services.CodeGen; -using HydraScript.Services.SourceCode; - -namespace HydraScript.Services.Executor.Impl; - -public class Executor : IExecutor -{ - private readonly IParsingService _parsingService; - private readonly ISourceCodeProvider _sourceCodeProvider; - private readonly ICodeGenService _codeGenService; - - public Executor( - IParsingService parsingService, - ISourceCodeProvider sourceCodeProvider, - ICodeGenService codeGenService) - { - _parsingService = parsingService; - _sourceCodeProvider = sourceCodeProvider; - _codeGenService = codeGenService; - } - - public void Execute() - { - try - { - var text = _sourceCodeProvider.GetText(); - var ast = _parsingService.Parse(text); - var instructions = _codeGenService.GetInstructions(ast); - - IVirtualMachine vm = new VirtualMachine(Console.Out); - vm.Run(instructions); - } - catch (Exception ex) - when (ex is LexerException or ParserException or SemanticException) - { - Console.WriteLine(ex.Message); - } - catch (Exception ex) - { - Console.WriteLine("Internal HydraScript Error"); - Console.WriteLine(ex); - } - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Parsing/IParsingService.cs b/src/HydraScript/Services/Parsing/IParsingService.cs deleted file mode 100644 index fbe4a389..00000000 --- a/src/HydraScript/Services/Parsing/IParsingService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Services.Parsing; - -public interface IParsingService -{ - IAbstractSyntaxTree Parse(string text); -} \ No newline at end of file diff --git a/src/HydraScript/Services/Parsing/Impl/ParsingService.cs b/src/HydraScript/Services/Parsing/Impl/ParsingService.cs deleted file mode 100644 index 57a775a8..00000000 --- a/src/HydraScript/Services/Parsing/Impl/ParsingService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using HydraScript.Services.Providers.ParserProvider; -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Services.Parsing.Impl; - -public class ParsingService : IParsingService -{ - private readonly IParserProvider _parserProvider; - - public ParsingService(IParserProvider parserProvider) - { - _parserProvider = parserProvider; - } - - public IAbstractSyntaxTree Parse(string text) - { - var parser = _parserProvider.CreateParser(); - return parser.TopDownParse(text); - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs b/src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs deleted file mode 100644 index 58f3f5c5..00000000 --- a/src/HydraScript/Services/Providers/LexerProvider/ILexerProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.FrontEnd.GetTokens; - -namespace HydraScript.Services.Providers.LexerProvider; - -public interface ILexerProvider -{ - ILexer CreateLexer(); -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs b/src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs deleted file mode 100644 index 3a3c5271..00000000 --- a/src/HydraScript/Services/Providers/LexerProvider/Impl/LexerProvider.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Services.Providers.StructureProvider; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Impl; -using Microsoft.Extensions.Options; - -namespace HydraScript.Services.Providers.LexerProvider.Impl; - -public class LexerProvider : ILexerProvider -{ - private readonly IStructureProvider _structureProvider; - private readonly ITextCoordinateSystemComputer _computer; - private readonly IFileSystem _fileSystem; - private readonly CommandLineSettings _settings; - - public LexerProvider( - IStructureProvider structureProvider, - ITextCoordinateSystemComputer computer, - IFileSystem fileSystem, - IOptions options) - { - _structureProvider = structureProvider; - _computer = computer; - _fileSystem = fileSystem; - _settings = options.Value; - } - - public ILexer CreateLexer() - { - var structure = _structureProvider.CreateStructure(); - var lexer = new Lexer(structure, _computer); - var inputFileName = _settings.InputFilePath.Split(".js")[0]; - return _settings.Dump - ? new LoggingLexer(lexer, inputFileName, _fileSystem) - : lexer; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs b/src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs deleted file mode 100644 index 33a0bc74..00000000 --- a/src/HydraScript/Services/Providers/LexerProvider/Impl/LoggingLexer.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.IO.Abstractions; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Data; - -namespace HydraScript.Services.Providers.LexerProvider.Impl; - -public class LoggingLexer : ILexer -{ - private readonly ILexer _lexer; - private readonly string _fileName; - private readonly IFileSystem _fileSystem; - - public LoggingLexer(ILexer lexer, string fileName, IFileSystem fileSystem) - { - _lexer = lexer; - _fileName = fileName; - _fileSystem = fileSystem; - } - - [ExcludeFromCodeCoverage] - public Structure Structure => _lexer.Structure; - - public List GetTokens(string text) - { - var tokens = _lexer.GetTokens(text); - _fileSystem.File.WriteAllText( - $"{_fileName}.tokens", - _lexer.ToString() - ); - return tokens; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs b/src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs deleted file mode 100644 index a846c091..00000000 --- a/src/HydraScript/Services/Providers/ParserProvider/IParserProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.FrontEnd.TopDownParse; - -namespace HydraScript.Services.Providers.ParserProvider; - -public interface IParserProvider -{ - IParser CreateParser(); -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs deleted file mode 100644 index 148cd68a..00000000 --- a/src/HydraScript/Services/Providers/ParserProvider/Impl/LoggingParser.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.IR.Ast; - -namespace HydraScript.Services.Providers.ParserProvider.Impl; - -public class LoggingParser : IParser -{ - private readonly IParser _parser; - private readonly IFileSystem _fileSystem; - - public LoggingParser(IParser parser, IFileSystem fileSystem) - { - _parser = parser; - _fileSystem = fileSystem; - } - - public IAbstractSyntaxTree TopDownParse(string text) - { - var ast = _parser.TopDownParse(text); - var astDot = ast.ToString(); - _fileSystem.File.WriteAllText("ast.dot", astDot); - return ast; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs b/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs deleted file mode 100644 index 20cda958..00000000 --- a/src/HydraScript/Services/Providers/ParserProvider/Impl/ParserProvider.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Services.Providers.LexerProvider; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.FrontEnd.TopDownParse.Impl; -using Microsoft.Extensions.Options; - -namespace HydraScript.Services.Providers.ParserProvider.Impl; - -public class ParserProvider : IParserProvider -{ - private readonly ILexerProvider _lexerProvider; - private readonly IFileSystem _fileSystem; - private readonly CommandLineSettings _settings; - - public ParserProvider( - ILexerProvider lexerProvider, - IFileSystem fileSystem, - IOptions options) - { - _lexerProvider = lexerProvider; - _fileSystem = fileSystem; - _settings = options.Value; - } - - public IParser CreateParser() - { - var lexer = _lexerProvider.CreateLexer(); - var parser = new Parser(lexer); - return _settings.Dump - ? new LoggingParser(parser, _fileSystem) - : parser; - } -} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs b/src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs deleted file mode 100644 index 8f4521ea..00000000 --- a/src/HydraScript/Services/Providers/StructureProvider/IStructureProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -using HydraScript.Lib.FrontEnd.GetTokens.Data; - -namespace HydraScript.Services.Providers.StructureProvider; - -public interface IStructureProvider -{ - Structure CreateStructure(); -} \ No newline at end of file diff --git a/src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs b/src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs deleted file mode 100644 index a6effc9a..00000000 --- a/src/HydraScript/Services/SourceCode/ISourceCodeProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace HydraScript.Services.SourceCode; - -public interface ISourceCodeProvider -{ - string GetText(); -} \ No newline at end of file diff --git a/src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs b/src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs deleted file mode 100644 index d4f63d3f..00000000 --- a/src/HydraScript/Services/SourceCode/Impl/SourceCodeProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.IO.Abstractions; -using Microsoft.Extensions.Options; - -namespace HydraScript.Services.SourceCode.Impl; - -internal class SourceCodeProvider : ISourceCodeProvider -{ - private readonly IFileSystem _fileSystem; - private readonly CommandLineSettings _commandLineSettings; - - public SourceCodeProvider( - IFileSystem fileSystem, - IOptions commandLineSettings) - { - _fileSystem = fileSystem; - _commandLineSettings = commandLineSettings.Value; - } - - public string GetText() - { - var inputFilePath = _commandLineSettings.InputFilePath; - return _fileSystem.File.ReadAllText(inputFilePath); - } -} \ No newline at end of file diff --git a/src/HydraScript/TokenTypes.cs b/src/HydraScript/TokenTypes.cs deleted file mode 100644 index dc86c0a4..00000000 --- a/src/HydraScript/TokenTypes.cs +++ /dev/null @@ -1,116 +0,0 @@ -namespace HydraScript; - -public static class TokenTypes -{ - public const string Json = - """ - [ - { - "tag": "Comment", - "pattern": "[\/]{2}.*", - "priority": 0, - "canIgnore": true - }, - { - "tag": "Ident", - "pattern": "[a-zA-Z][a-zA-Z0-9]*", - "priority": 50 - }, - { - "tag": "IntegerLiteral", - "pattern": "[0-9]+", - "priority": 3 - }, - { - "tag": "FloatLiteral", - "pattern": "[0-9]+[.][0-9]+", - "priority": 2 - }, - { - "tag": "NullLiteral", - "pattern": "null", - "priority": 4 - }, - { - "tag": "BooleanLiteral", - "pattern": "true|false", - "priority": 5 - }, - { - "tag": "StringLiteral", - "pattern": "\\\"(\\\\.|[^\"\\\\])*\\\"", - "priority": 6 - }, - { - "tag": "Keyword", - "pattern": "let|const|function|if|else|while|break|continue|return|as|type", - "priority": 11 - }, - { - "tag": "Operator", - "pattern": "[+]{1,2}|[-]|[*]|[\/]|[%]|([!]|[=])[=]|([<]|[>])[=]?|[!]|[|]{2}|[&]{2}|[~]|[:]{2}", - "priority": 12 - }, - { - "tag": "Comma", - "pattern": "[,]", - "priority": 100 - }, - { - "tag": "Dot", - "pattern": "[.]", - "priority": 105 - }, - { - "tag": "LeftCurl", - "pattern": "[{]", - "priority": 101 - }, - { - "tag": "RightCurl", - "pattern": "[}]", - "priority": 102 - }, - { - "tag": "LeftParen", - "pattern": "[(]", - "priority": 103 - }, - { - "tag": "RightParen", - "pattern": "[)]", - "priority": 104 - }, - { - "tag": "LeftBracket", - "pattern": "[[]", - "priority": 107 - }, - { - "tag": "RightBracket", - "pattern": "[]]", - "priority": 109 - }, - { - "tag": "Assign", - "pattern": "[=]", - "priority": 99 - }, - { - "tag": "QuestionMark", - "pattern": "[?]", - "priority": 90 - }, - { - "tag": "Colon", - "pattern": "[:]", - "priority": 91 - }, - { - "tag": "SemiColon", - "pattern": "[;]", - "priority": 92 - } - ] - """; -} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs b/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs new file mode 100644 index 00000000..a02152ab --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs @@ -0,0 +1,30 @@ +using HydraScript.Application.CodeGeneration; +using HydraScript.Application.StaticAnalysis; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.FrontEnd.Parser; +using Microsoft.Extensions.DependencyInjection; +using Visitor.NET; + +namespace HydraScript.Infrastructure; + +internal class CodeGenerator : ICodeGenerator +{ + private readonly IStaticAnalyzer _staticAnalyzer; + private readonly IVisitor _visitor; + + public CodeGenerator( + IStaticAnalyzer staticAnalyzer, + [FromKeyedServices("instructions")] + IVisitor visitor) + { + _staticAnalyzer = staticAnalyzer; + _visitor = visitor; + } + + public AddressedInstructions GetInstructions(IAbstractSyntaxTree ast) + { + _staticAnalyzer.Analyze(ast); + var root = ast.Root; + return root.Accept(_visitor); + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj new file mode 100644 index 00000000..91b001c8 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + enable + enable + True + + + + + + + + + + + + + + + + + + diff --git a/src/Infrastructure/HydraScript.Infrastructure/ISourceCodeProvider.cs b/src/Infrastructure/HydraScript.Infrastructure/ISourceCodeProvider.cs new file mode 100644 index 00000000..a3c77813 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/ISourceCodeProvider.cs @@ -0,0 +1,22 @@ +using System.IO.Abstractions; +using Microsoft.Extensions.Options; + +namespace HydraScript.Infrastructure; + +public interface ISourceCodeProvider +{ + string GetText(); +} + +internal class SourceCodeProvider( + IFileSystem fileSystem, + IOptions inputFile) : ISourceCodeProvider +{ + private readonly InputFile _inputFile = inputFile.Value; + + public string GetText() + { + var inputFilePath = _inputFile.Info.FullName; + return fileSystem.File.ReadAllText(inputFilePath); + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/InputFile.cs b/src/Infrastructure/HydraScript.Infrastructure/InputFile.cs new file mode 100644 index 00000000..f6de800a --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/InputFile.cs @@ -0,0 +1,6 @@ +namespace HydraScript.Infrastructure; + +public class InputFile +{ + public required FileInfo Info { get; init; } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs new file mode 100644 index 00000000..07606705 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs @@ -0,0 +1,27 @@ +using System.Diagnostics.CodeAnalysis; +using System.IO.Abstractions; +using HydraScript.Domain.FrontEnd.Lexer; +using Microsoft.Extensions.Options; + +namespace HydraScript.Infrastructure.Logging; + +internal class LoggingLexer( + ILexer lexer, + IFileSystem fileSystem, + IOptions inputFile) : ILexer +{ + private readonly InputFile _inputFile = inputFile.Value; + + [ExcludeFromCodeCoverage] + public Structure Structure => lexer.Structure; + + public List GetTokens(string text) + { + var tokens = lexer.GetTokens(text); + var fileName = _inputFile.Info.Name.Split(".js")[0]; + fileSystem.File.WriteAllText( + $"{fileName}.tokens", + lexer.ToString()); + return tokens; + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingParser.cs b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingParser.cs new file mode 100644 index 00000000..d6f3c36d --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingParser.cs @@ -0,0 +1,15 @@ +using System.IO.Abstractions; +using HydraScript.Domain.FrontEnd.Parser; + +namespace HydraScript.Infrastructure.Logging; + +internal class LoggingParser(IParser parser, IFileSystem fileSystem) : IParser +{ + public IAbstractSyntaxTree Parse(string text) + { + var ast = parser.Parse(text); + var astDot = ast.ToString(); + fileSystem.File.WriteAllText("ast.dot", astDot); + return ast; + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingVirtualMachine.cs b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingVirtualMachine.cs new file mode 100644 index 00000000..321ea676 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingVirtualMachine.cs @@ -0,0 +1,25 @@ +using System.IO.Abstractions; +using HydraScript.Domain.BackEnd; +using Microsoft.Extensions.Options; + +namespace HydraScript.Infrastructure.Logging; + +internal class LoggingVirtualMachine( + IVirtualMachine virtualMachine, + IFileSystem fileSystem, + IOptions inputFile) : IVirtualMachine +{ + private readonly InputFile _inputFile = inputFile.Value; + + public IExecuteParams ExecuteParams => virtualMachine.ExecuteParams; + + public void Run(AddressedInstructions instructions) + { + var fileName = _inputFile.Info.Name.Split(".js")[0]; + fileSystem.File.WriteAllLines( + $"{fileName}.tac", + instructions.Select(i => i.ToString()!)); + + virtualMachine.Run(instructions); + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs b/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..dc285de9 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs @@ -0,0 +1,55 @@ +using System.IO.Abstractions; +using HydraScript.Application.CodeGeneration; +using HydraScript.Application.StaticAnalysis; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.Impl; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl; +using HydraScript.Infrastructure.Logging; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + +namespace HydraScript.Infrastructure; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDomain(this IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(StructureInstance.Get); + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(Console.Out); + services.AddSingleton(); + + return services; + } + + public static IServiceCollection AddApplication(this IServiceCollection services) => services + .AddStaticAnalysis() + .AddCodeGeneration(); + + public static void AddInfrastructure( + this IServiceCollection services, + bool dump, + FileInfo inputFileInfo) + { + services.AddSingleton(); + services.AddSingleton(Options.Create(new InputFile { Info = inputFileInfo })); + + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + + if (dump) + { + services.Decorate(); + services.Decorate(); + services.Decorate(); + } + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/StaticAnalyzer.cs b/src/Infrastructure/HydraScript.Infrastructure/StaticAnalyzer.cs new file mode 100644 index 00000000..62942cea --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/StaticAnalyzer.cs @@ -0,0 +1,22 @@ +using HydraScript.Application.StaticAnalysis; +using HydraScript.Domain.FrontEnd.Parser; +using Visitor.NET; +using Type = HydraScript.Domain.IR.Types.Type; + +namespace HydraScript.Infrastructure; + +internal class StaticAnalyzer( + IEnumerable> preAnalyzers, + IVisitor analyzer) : IStaticAnalyzer +{ + public void Analyze(IAbstractSyntaxTree ast) + { + var root = ast.Root; + foreach (var preAnalyzer in preAnalyzers) + { + root.Accept(preAnalyzer); + } + + root.Accept(analyzer); + } +} \ No newline at end of file diff --git a/src/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs b/src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs similarity index 68% rename from src/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs rename to src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs index 9f7ce424..91d138dd 100644 --- a/src/HydraScript/Services/Providers/StructureProvider/Impl/StructureProvider.cs +++ b/src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs @@ -1,20 +1,29 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -namespace HydraScript.Services.Providers.StructureProvider.Impl; +namespace HydraScript.Infrastructure; -public class StructureProvider : IStructureProvider +internal static class StructureInstance { - public Structure CreateStructure() => - JsonSerializer.Deserialize( - TokenTypes.Json, - new JsonSerializerOptions - { - Converters = { new StructureReadConverter() } - })!; + private static readonly JsonSerializerOptions JsonSerializerOptions = new() + { + Converters = { new StructureReadConverter() } + }; + + private static Structure? _instance; + public static Structure Get + { + get + { + _instance ??= JsonSerializer.Deserialize( + TokenTypesJson.String, + JsonSerializerOptions)!; + return _instance; + } + } [ExcludeFromCodeCoverage] private class StructureReadConverter : JsonConverter diff --git a/tests/HydraScript.IntegrationTests/GlobalUsings.cs b/tests/HydraScript.IntegrationTests/GlobalUsings.cs new file mode 100644 index 00000000..75a33966 --- /dev/null +++ b/tests/HydraScript.IntegrationTests/GlobalUsings.cs @@ -0,0 +1,3 @@ +// Global using directives + +global using Xunit; \ No newline at end of file diff --git a/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj new file mode 100644 index 00000000..b02729e6 --- /dev/null +++ b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj @@ -0,0 +1,138 @@ + + + + net8.0 + enable + enable + True + false + true + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + Samples\abs.js + Always + + + Samples\arraddremove.js + Always + + + Samples\arreditread.js + Always + + + Samples\ceil.js + Always + + + Samples\defaultarray.js + Always + + + Samples\equals.js + Always + + + Samples\exprtest.js + Always + + + Samples\fastpow.js + Always + + + Samples\forwardref.js + Always + + + Samples\gcd.js + Always + + + Samples\lcm.js + Always + + + Samples\linkedlist.js + Always + + + Samples\objeditread.js + Always + + + Samples\posneg.js + Always + + + Samples\prime.js + Always + + + Samples\primefactor.js + Always + + + Samples\quicksort.js + Always + + + Samples\range.js + Always + + + Samples\recur.js + Always + + + Samples\searchinll.js + Always + + + Samples\settable.js + Always + + + Samples\squareroot.js + Always + + + Samples\summator.js + Always + + + Samples\tern.js + Always + + + Samples\this.js + Always + + + Samples\typeresolving.js + Always + + + Samples\vec2d.js + Always + + + + diff --git a/tests/HydraScript.IntegrationTests/Properties/AssemblyInfo.cs b/tests/HydraScript.IntegrationTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..4c5fd931 --- /dev/null +++ b/tests/HydraScript.IntegrationTests/Properties/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: AssemblyTrait("Category", "Integration")] \ No newline at end of file diff --git a/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs b/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs new file mode 100644 index 00000000..bce5ee2e --- /dev/null +++ b/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs @@ -0,0 +1,51 @@ +using System.CommandLine.Parsing; +using FluentAssertions; +using Xunit.Abstractions; + +namespace HydraScript.IntegrationTests; + +public class SuccessfulProgramsTests( + TestHostFixture fixture, + ITestOutputHelper testOutputHelper) : IClassFixture +{ + [Theory, MemberData(nameof(SuccessfulProgramsNames))] + public void Invoke_NoError_ReturnCodeIsZero(string fileName) + { + var runner = fixture.GetRunner(testOutputHelper); + var code = runner.Invoke([$"Samples/{fileName}"]); + testOutputHelper.WriteLine(fixture.Writer.ToString()); + code.Should().Be(0); + } + + public static TheoryData SuccessfulProgramsNames => + new( + [ + "abs.js", + "arraddremove.js", + "arreditread.js", + "ceil.js", + "defaultarray.js", + "equals.js", + "exprtest.js", + "fastpow.js", + "forwardref.js", + "gcd.js", + "lcm.js", + "linkedlist.js", + "objeditread.js", + "posneg.js", + "prime.js", + "primefactor.js", + "quicksort.js", + "range.js", + "recur.js", + "searchinll.js", + "settable.js", + "squareroot.js", + "summator.js", + "tern.js", + "this.js", + "typeresolving.js", + "vec2d.js", + ]); +} \ No newline at end of file diff --git a/tests/HydraScript.IntegrationTests/TestHostFixture.cs b/tests/HydraScript.IntegrationTests/TestHostFixture.cs new file mode 100644 index 00000000..eec77ca6 --- /dev/null +++ b/tests/HydraScript.IntegrationTests/TestHostFixture.cs @@ -0,0 +1,36 @@ +using System.CommandLine.Hosting; +using System.CommandLine.Parsing; +using HydraScript.Infrastructure; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Xunit.Abstractions; + +namespace HydraScript.IntegrationTests; + +public class TestHostFixture : IDisposable +{ + public readonly TextWriter Writer = new StringWriter(); + + public Parser GetRunner(ITestOutputHelper testOutputHelper) => + Program.GetRunner(configureHost: builder => builder + .ConfigureLogging(x => + { + x.ClearProviders(); + x.AddXUnit(testOutputHelper); + }) + .ConfigureServices((context, services) => + { + var parseResult = context.GetInvocationContext().ParseResult; + var fileInfo = parseResult.GetValueForArgument(Program.Command.PathArgument); + var dump = parseResult.GetValueForOption(Program.Command.DumpOption); + services + .AddDomain() + .AddApplication() + .AddInfrastructure(dump, fileInfo); + services.AddSingleton(Writer); + }) + .UseCommandHandler()); + + public void Dispose() => Writer.Dispose(); +} \ No newline at end of file diff --git a/tests/HydraScript.Tests/GlobalUsings.cs b/tests/HydraScript.Tests/GlobalUsings.cs index 4f46c67a..c59d4898 100644 --- a/tests/HydraScript.Tests/GlobalUsings.cs +++ b/tests/HydraScript.Tests/GlobalUsings.cs @@ -1,3 +1,4 @@ // Global using directives + global using FluentAssertions; -global using Type = HydraScript.Lib.IR.CheckSemantics.Types.Type; \ No newline at end of file +global using Type = HydraScript.Domain.IR.Types.Type; \ No newline at end of file diff --git a/tests/HydraScript.Tests/Helpers/MockExtensions.cs b/tests/HydraScript.Tests/Helpers/MockExtensions.cs index 8037376a..a64adcf0 100644 --- a/tests/HydraScript.Tests/Helpers/MockExtensions.cs +++ b/tests/HydraScript.Tests/Helpers/MockExtensions.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; using Moq; namespace HydraScript.Tests.Helpers; diff --git a/tests/HydraScript.Tests/HydraScript.Tests.csproj b/tests/HydraScript.Tests/HydraScript.Tests.csproj index a9204265..ea1555a3 100644 --- a/tests/HydraScript.Tests/HydraScript.Tests.csproj +++ b/tests/HydraScript.Tests/HydraScript.Tests.csproj @@ -2,10 +2,11 @@ net8.0 - false enable enable True + false + true @@ -15,25 +16,24 @@ - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - diff --git a/tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs b/tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs index aa55647a..527819c7 100644 --- a/tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs +++ b/tests/HydraScript.Tests/Stubs/SemanticExceptionStub.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.IR.CheckSemantics.Exceptions; +using HydraScript.Application.StaticAnalysis.Exceptions; namespace HydraScript.Tests.Stubs; diff --git a/tests/HydraScript.Tests/TestData/InstructionsData.cs b/tests/HydraScript.Tests/TestData/InstructionsData.cs index 5f6311f1..7c07faee 100644 --- a/tests/HydraScript.Tests/TestData/InstructionsData.cs +++ b/tests/HydraScript.Tests/TestData/InstructionsData.cs @@ -1,12 +1,12 @@ using System.Collections; -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Domain.BackEnd.Impl.Values; namespace HydraScript.Tests.TestData; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs index 13a7a102..821f1d73 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/AddressedInstructionsTests.cs @@ -1,8 +1,8 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Domain.BackEnd.Impl.Values; using HydraScript.Tests.Helpers; using Xunit; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs index 9a4d2977..e37a1948 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/CallTests.cs @@ -1,5 +1,5 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs index 10f0a6f2..63bb9755 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/HashAddressTests.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Addresses; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs index 28804531..3f48ec2b 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/InstructionsTests.cs @@ -1,6 +1,6 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; using HydraScript.Tests.TestData; using Moq; using Xunit; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs index 6397dcf6..7b9ffa62 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/ValuesTests.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd.Impl.Values; using Xunit; namespace HydraScript.Tests.Unit.BackEnd; diff --git a/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs b/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs index 8e900e97..5c62b90f 100644 --- a/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs +++ b/tests/HydraScript.Tests/Unit/BackEnd/VirtualMachineTests.cs @@ -1,12 +1,12 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl; -using HydraScript.Lib.BackEnd.Impl.Addresses; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; -using HydraScript.Lib.BackEnd.Impl.Instructions.WithJump; -using HydraScript.Lib.BackEnd.Impl.Values; +using HydraScript.Domain.BackEnd; +using HydraScript.Domain.BackEnd.Impl; +using HydraScript.Domain.BackEnd.Impl.Addresses; +using HydraScript.Domain.BackEnd.Impl.Instructions; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Create; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment.ComplexData.Write; +using HydraScript.Domain.BackEnd.Impl.Instructions.WithJump; +using HydraScript.Domain.BackEnd.Impl.Values; using HydraScript.Tests.Helpers; using Moq; using Xunit; diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs similarity index 51% rename from tests/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs index d3b4c30a..76d6c12d 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/LexerTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs @@ -1,39 +1,39 @@ -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Impl; -using HydraScript.Services.Providers.StructureProvider.Impl; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.Impl; +using HydraScript.Infrastructure; using HydraScript.Tests.TestData; using Xunit; namespace HydraScript.Tests.Unit.FrontEnd; -public class LexerTests +public class RegexLexerTests { - private readonly Lexer _lexer = new( - new StructureProvider().CreateStructure(), + private readonly RegexLexer _regexLexer = new( + StructureInstance.Get, new TextCoordinateSystemComputer()); [Theory] [ClassData(typeof(LexerSuccessData))] public void LexerDoesNotThrowTest(string text) => - Assert.Null(Record.Exception(() => _lexer.GetTokens(text))); + Assert.Null(Record.Exception(() => _regexLexer.GetTokens(text))); [Theory] [ClassData(typeof(LexerFailData))] public void LexerThrowsErrorTest(string text) => - Assert.Throws(() => _lexer.GetTokens(text)); + Assert.Throws(() => _regexLexer.GetTokens(text)); [Fact] public void LexerToStringCorrectTest() { const string text = "8"; - var tokens = _lexer.GetTokens(text); - Assert.Contains("EOP", _lexer.ToString()); + var tokens = _regexLexer.GetTokens(text); + Assert.Contains("EOP", _regexLexer.ToString()); Assert.Equal("IntegerLiteral (1, 1)-(1, 2): 8", tokens.First().ToString()); } [Fact] public void EmptyTextTest() => - Assert.NotEmpty(_lexer.GetTokens("")); + Assert.NotEmpty(_regexLexer.GetTokens("")); [Fact] public void GetTokensSkipIgnorableTypesTest() @@ -41,7 +41,7 @@ public void GetTokensSkipIgnorableTypesTest() const string text = @" let x = 1 // int "; - var tokens = _lexer.GetTokens(text); - Assert.DoesNotContain(_lexer.Structure.FindByTag("Comment"), tokens.Select(x => x.Type)); + var tokens = _regexLexer.GetTokens(text); + Assert.DoesNotContain(_regexLexer.Structure.FindByTag("Comment"), tokens.Select(x => x.Type)); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs index 4e822857..1e8c0097 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs @@ -1,5 +1,5 @@ -using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; using Xunit; namespace HydraScript.Tests.Unit.FrontEnd; diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs index c9f5fe1f..dd82f858 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/TextCoordinateSystemComputerTests.cs @@ -1,5 +1,5 @@ -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Impl; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.Impl; using Xunit; namespace HydraScript.Tests.Unit.FrontEnd; diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs similarity index 50% rename from tests/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs rename to tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs index f7498821..c27055f8 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/ParserTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs @@ -1,17 +1,16 @@ -using HydraScript.Lib.FrontEnd.GetTokens.Impl; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.FrontEnd.TopDownParse.Impl; -using HydraScript.Services.Providers.StructureProvider.Impl; +using HydraScript.Domain.FrontEnd.Lexer.Impl; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Domain.FrontEnd.Parser.Impl; +using HydraScript.Infrastructure; using HydraScript.Tests.TestData; using Xunit; namespace HydraScript.Tests.Unit.FrontEnd; -public class ParserTests +public class TopDownParserTests { - private readonly IParser _parser = new Parser(new Lexer( - new StructureProvider() - .CreateStructure(), + private readonly IParser _parser = new TopDownParser(new RegexLexer( + StructureInstance.Get, new TextCoordinateSystemComputer())); [Theory] @@ -21,7 +20,7 @@ public void ParserDoesNotThrowTest(string text) var ex = Record.Exception(() => { // ReSharper disable once UnusedVariable - var ast = _parser.TopDownParse(text); + var ast = _parser.Parse(text); }); Assert.Null(ex); } diff --git a/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs b/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs index 7f3341e1..79a07e88 100644 --- a/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/AstNodeTests.cs @@ -1,9 +1,12 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; using Xunit; +using BlockStatement = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements.BlockStatement; +using FunctionDeclaration = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded.FunctionDeclaration; +using IdentifierReference = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions.IdentifierReference; +using LexicalDeclaration = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded.LexicalDeclaration; +using Literal = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions.Literal; +using ScriptBody = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.ScriptBody; +using TypeIdentValue = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.TypeIdentValue; namespace HydraScript.Tests.Unit.IR; diff --git a/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs b/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs index 4d2e3c37..caebadad 100644 --- a/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/FunctionWithUndefinedReturnStorageTests.cs @@ -1,13 +1,13 @@ -using HydraScript.Lib.IR.Ast.Impl.Nodes; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Declarations.AfterTypesAreLoaded; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Expressions.PrimaryExpressions; -using HydraScript.Lib.IR.Ast.Impl.Nodes.Statements; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl.Symbols; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +using HydraScript.Application.StaticAnalysis; +using HydraScript.Application.StaticAnalysis.Impl; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; +using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; +using HydraScript.Domain.IR.Impl.Symbols; using Moq; using Xunit; +using BlockStatement = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Statements.BlockStatement; +using FunctionDeclaration = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations.AfterTypesAreLoaded.FunctionDeclaration; +using IdentifierReference = HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Expressions.PrimaryExpressions.IdentifierReference; namespace HydraScript.Tests.Unit.IR; diff --git a/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs b/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs index 1e580628..737d8c6c 100644 --- a/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/SymbolTableTests.cs @@ -1,5 +1,5 @@ -using HydraScript.Lib.IR.CheckSemantics.Variables; -using HydraScript.Lib.IR.CheckSemantics.Variables.Impl; +using HydraScript.Domain.IR; +using HydraScript.Domain.IR.Impl; using Moq; using Xunit; diff --git a/tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs b/tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs index 58bf7ac5..600e85a5 100644 --- a/tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/Types/ObjectTypeTests.cs @@ -1,4 +1,4 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; +using HydraScript.Domain.IR.Types; using Xunit; namespace HydraScript.Tests.Unit.IR.Types; diff --git a/tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs b/tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs index 3462dc33..c504e2c6 100644 --- a/tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs +++ b/tests/HydraScript.Tests/Unit/IR/Types/TypeTests.cs @@ -1,5 +1,5 @@ -using HydraScript.Lib.IR.CheckSemantics.Types; -using HydraScript.Lib.IR.CheckSemantics.Visitors.Services.Impl; +using HydraScript.Application.StaticAnalysis.Impl; +using HydraScript.Domain.IR.Types; using Xunit; namespace HydraScript.Tests.Unit.IR.Types; diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs deleted file mode 100644 index 7eafbdcd..00000000 --- a/tests/HydraScript.Tests/Unit/Infrastructure/ExecutorTests.cs +++ /dev/null @@ -1,117 +0,0 @@ -using HydraScript.Lib.BackEnd; -using HydraScript.Lib.BackEnd.Impl.Instructions; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.IR.Ast; -using HydraScript.Services.CodeGen; -using HydraScript.Services.Executor.Impl; -using HydraScript.Services.Parsing; -using HydraScript.Services.SourceCode; -using HydraScript.Tests.Stubs; -using Moq; -using Xunit; - -namespace HydraScript.Tests.Unit.Infrastructure; - -public class ExecutorTests -{ - private readonly Mock _parsingService; - - public ExecutorTests() - { - _parsingService = new Mock(); - } - - [Fact] - public void ExecuteGoesOkTest() - { - var ast = new Mock(); - ast.Setup(x => x.Root) - .Returns(Mock.Of()); - - _parsingService.Setup(x => x.Parse(It.IsAny())) - .Returns(ast.Object); - - var codeGenService = new Mock(); - codeGenService.Setup(x => x.GetInstructions(It.IsAny())) - .Returns([new Halt()]); - - var executor = new Executor( - _parsingService.Object, - Mock.Of(), - codeGenService.Object); - Assert.Null(Record.Exception(() => executor.Execute())); - } - - [Fact] - public void SemanticExceptionCaughtTest() - { - var ast = new Mock(); - ast.Setup(x => x.Root) - .Returns(Mock.Of()); - - _parsingService.Setup(x => x.Parse(It.IsAny())) - .Returns(ast.Object); - - var codeGenService = new Mock(); - codeGenService.Setup(x => x.GetInstructions(It.IsAny())) - .Throws(); - - var executor = new Executor( - _parsingService.Object, - Mock.Of(), - codeGenService.Object); - Assert.Null(Record.Exception(() => executor.Execute())); - } - - [Fact] - public void LexerExceptionCaughtTest() - { - _parsingService.Setup(x => x.Parse(It.IsAny())) - .Throws(); - - var executor = new Executor( - _parsingService.Object, - Mock.Of(), - Mock.Of()); - Assert.Null(Record.Exception(() => executor.Execute())); - } - - [Fact] - public void ParserExceptionCaughtTest() - { - _parsingService.Setup(x => x.Parse(It.IsAny())) - .Throws(); - - var executor = new Executor( - _parsingService.Object, - Mock.Of(), - Mock.Of()); - Assert.Null(Record.Exception(() => executor.Execute())); - } - - [Fact] - public void InternalInterpreterErrorCaughtTest() - { - var instruction = new Mock(); - instruction.Setup(x => x.Execute(It.IsAny())) - .Throws(); - - var ast = new Mock(); - ast.Setup(x => x.Root) - .Returns(Mock.Of()); - - _parsingService.Setup(x => x.Parse(It.IsAny())) - .Returns(ast.Object); - - var codeGenService = new Mock(); - codeGenService.Setup(x => x.GetInstructions(It.IsAny())) - .Returns([instruction.Object, new Halt()]); - - var executor = new Executor( - _parsingService.Object, - Mock.Of(), - codeGenService.Object); - Assert.Null(Record.Exception(() => executor.Execute())); - } -} \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs index fe7812c1..e620c6e3 100644 --- a/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs +++ b/tests/HydraScript.Tests/Unit/Infrastructure/LoggingEntitiesTests.cs @@ -1,10 +1,9 @@ using System.IO.Abstractions; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.IR.Ast; -using HydraScript.Services.Providers.LexerProvider.Impl; -using HydraScript.Services.Providers.ParserProvider.Impl; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Parser; +using HydraScript.Infrastructure; +using HydraScript.Infrastructure.Logging; +using Microsoft.Extensions.Options; using Moq; using Xunit; @@ -29,20 +28,27 @@ public void CorrectFileNameProducedByLexerTest() { var lexer = new Mock(); lexer.Setup(x => x.GetTokens(It.IsAny())) - .Returns(new List()); + .Returns([]); lexer.Setup(x => x.ToString()) .Returns("lexer"); - _file.Setup(x => x.WriteAllText( - It.IsAny(), It.IsAny() - )).Verifiable(); + _file.Setup( + x => x.WriteAllText( + It.IsAny(), + It.IsAny())) + .Verifiable(); - var loggingLexer = new LoggingLexer(lexer.Object, "file", _fileSystem.Object); + var loggingLexer = new LoggingLexer( + lexer.Object, + _fileSystem.Object, + inputFile: Options.Create(new InputFile { Info = new FileInfo("file") })); loggingLexer.GetTokens(""); - _file.Verify(x => x.WriteAllText( - It.Is(p => p == "file.tokens"), It.Is(c => c == "lexer") - ), Times.Once()); + _file.Verify( + x => x.WriteAllText( + It.Is(p => p == "file.tokens"), + It.Is(c => c == "lexer")), + Times.Once()); } [Fact] @@ -53,7 +59,7 @@ public void CorrectTreeWrittenAndLoggingTreeProducedTest() .Returns("digraph ast { }"); var parser = new Mock(); - parser.Setup(x => x.TopDownParse(It.IsAny())) + parser.Setup(x => x.Parse(It.IsAny())) .Returns(ast.Object); _file.Setup(x => x.WriteAllText( @@ -61,11 +67,12 @@ public void CorrectTreeWrittenAndLoggingTreeProducedTest() )).Verifiable(); var loggingParser = new LoggingParser(parser.Object, _fileSystem.Object); - _ = loggingParser.TopDownParse(""); + _ = loggingParser.Parse(""); - _file.Verify(x => x.WriteAllText( - It.Is(p => p == "ast.dot"), - It.Is(c => c == "digraph ast { }") - ), Times.Once()); + _file.Verify( + x => x.WriteAllText( + It.Is(p => p == "ast.dot"), + It.Is(c => c == "digraph ast { }")), + Times.Once()); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs deleted file mode 100644 index 37f4393b..00000000 --- a/tests/HydraScript.Tests/Unit/Infrastructure/ParsingServiceTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -using HydraScript.Lib.FrontEnd.TopDownParse; -using HydraScript.Lib.IR.Ast; -using HydraScript.Services.Parsing.Impl; -using HydraScript.Services.Providers.ParserProvider; -using Moq; -using Xunit; - -namespace HydraScript.Tests.Unit.Infrastructure; - -public class ParsingServiceTests -{ - [Fact] - public void CertainTextHasBeenParsedTest() - { - const string text = "let x = 1 + 2 - 3"; - - var ast = new Mock(); - var parser = new Mock(); - parser.Setup(x => x.TopDownParse(It.IsAny())) - .Returns(ast.Object).Verifiable(); - - var parserProvider = new Mock(); - parserProvider.Setup(x => x.CreateParser()) - .Returns(parser.Object); - - var parsingService = new ParsingService(parserProvider.Object); - parsingService.Parse(text); - - parser.Verify(x => x.TopDownParse( - It.Is(s => s == text) - ), Times.Once()); - } -} \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs deleted file mode 100644 index 23021472..00000000 --- a/tests/HydraScript.Tests/Unit/Infrastructure/ProvidersTests.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.IO.Abstractions; -using HydraScript.Lib.FrontEnd.GetTokens; -using HydraScript.Lib.FrontEnd.GetTokens.Data; -using HydraScript.Lib.FrontEnd.GetTokens.Data.TokenTypes; -using HydraScript.Lib.FrontEnd.GetTokens.Impl; -using HydraScript.Lib.FrontEnd.TopDownParse.Impl; -using HydraScript.Services.Providers.LexerProvider; -using HydraScript.Services.Providers.LexerProvider.Impl; -using HydraScript.Services.Providers.ParserProvider.Impl; -using HydraScript.Services.Providers.StructureProvider; -using Microsoft.Extensions.Options; -using Moq; -using Xunit; -using SystemType = System.Type; - -namespace HydraScript.Tests.Unit.Infrastructure; - -public class ProvidersTests -{ - [Theory] - [InlineData(typeof(Lexer), false)] - [InlineData(typeof(LoggingLexer), true)] - public void CertainLexerProvidedTest(SystemType lexerType, bool dump) - { - var structureProvider = new Mock(); - structureProvider.Setup(x => x.CreateStructure()) - .Returns(new Structure(new List())); - - var options = new Mock>(); - options.Setup(x => x.Value) - .Returns(new CommandLineSettings - { - Dump = dump, - InputFilePath = "file.js" - }); - - var lexerProvider = new LexerProvider( - structureProvider.Object, - Mock.Of(), - Mock.Of(), - options.Object); - var lexer = lexerProvider.CreateLexer(); - - Assert.IsType(lexerType, lexer); - } - - [Theory] - [InlineData(typeof(Parser), false)] - [InlineData(typeof(LoggingParser), true)] - public void CertainParserProvidedTest(SystemType parserType, bool dump) - { - var options = new Mock>(); - options.Setup(x => x.Value) - .Returns(new CommandLineSettings - { - Dump = dump, - InputFilePath = "file.js" - }); - - var lexer = new Mock(); - var lexerProvider = new Mock(); - lexerProvider.Setup(x => x.CreateLexer()) - .Returns(lexer.Object); - - var parserProvider = new ParserProvider(lexerProvider.Object, Mock.Of(), options.Object); - var parser = parserProvider.CreateParser(); - - Assert.IsType(parserType, parser); - } -} \ No newline at end of file From 8f3aad8997ce252b12d12b49bb98a1aeb8eaf6ef Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 28 Jul 2024 21:39:55 +0300 Subject: [PATCH 17/35] change ci cd setup --- .github/workflows/develop.yml | 2 +- tests/HydraScript.Tests/HydraScript.Tests.csproj | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 53c44747..6ed212f5 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -37,7 +37,7 @@ jobs: run: dotnet build --no-restore -c Release -v n - name: Unit Tests run: | - dotnet test -c Release --no-build -v n --filter="Category=Unit" + dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Unit" mkdir coverage-report - name: Code Coverage Summary Report For Merge Request if: github.event_name == 'pull_request_target' diff --git a/tests/HydraScript.Tests/HydraScript.Tests.csproj b/tests/HydraScript.Tests/HydraScript.Tests.csproj index ea1555a3..0b82692e 100644 --- a/tests/HydraScript.Tests/HydraScript.Tests.csproj +++ b/tests/HydraScript.Tests/HydraScript.Tests.csproj @@ -8,11 +8,6 @@ false true - - - true - cobertura - From 8d2d18f3eea57184307f6665d1bbe166b0b27155 Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 28 Jul 2024 21:42:39 +0300 Subject: [PATCH 18/35] update Readme.md --- Readme.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Readme.md b/Readme.md index 6c56ca6c..4e56851b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,15 @@ -![Code Coverage](https://img.shields.io/badge/Code%20Coverage-43%25-critical?style=flat) - -Package | Line Rate | Health --------- | --------- | ------ -HydraScript.Lib | 40% | ❌ -HydraScript | 100% | ✔ -**Summary** | **43%** (925 / 2173) | ❌ +![Code Coverage](https://img.shields.io/badge/Code%20Coverage-41%25-critical?style=flat) + +| Package | Line Rate | Health | +|----------------------------------------|----------------------|--------| +| HydraScript | 0% | ❌ | +| HydraScript.Infrastructure | 31% | ❌ | +| HydraScript.Domain.BackEnd | 81% | ➖ | +| HydraScript.Application.CodeGeneration | 0% | ❌ | +| HydraScript.Domain.FrontEnd | 58% | ❌ | +| HydraScript.Application.StaticAnalysis | 4% | ❌ | +| HydraScript.Domain.IR | 74% | ❌ | +| **Summary** | **41%** (960 / 2358) | ❌ | _Minimum allowed line rate is `80%`_ From e48591850eb7c94858977a8040c3070adf57bd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sat, 3 Aug 2024 21:14:07 +0300 Subject: [PATCH 19/35] Feature/generated lexer (#77) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #57 - абстракция IStructure.cs * #57 - token types provider * #57 - DI refactoring * #57 - json highlight * #57 - абстракция IGeneratedRegexContainer * fix * #57 - SG project * #57 - fix SG launch * #57 - tests * #57 - удаление динамического построения RegEx * #57 - убрал лишнее из TokenType * #57 - тест на проверку подстановки * fix --- .github/workflows/develop.yml | 1 + ExtendedJavaScriptSubset.sln | 14 +++ ...raScript.Application.CodeGeneration.csproj | 2 +- ...raScript.Application.StaticAnalysis.csproj | 2 +- .../HydraScript.Domain.BackEnd.csproj | 2 +- .../HydraScript.Domain.FrontEnd.csproj | 2 +- .../Lexer/IGeneratedRegexContainer.cs | 8 ++ .../Lexer/ILexer.cs | 2 +- .../Lexer/IStructure.cs | 11 +++ .../Lexer/ITokenTypesProvider.cs | 8 ++ .../Lexer/Impl/RegexLexer.cs | 4 +- .../Lexer/Impl/Structure.cs | 31 ++++++ .../Lexer/Structure.cs | 54 ----------- .../Lexer/TokenTypes/EndOfProgramType.cs | 4 +- .../Lexer/TokenTypes/ErrorType.cs | 2 +- .../Lexer/TokenTypes/IgnorableType.cs | 3 +- .../Lexer/TokenTypes/TokenType.cs | 8 +- .../Lexer/TokenTypesJson.cs | 3 + .../Parser/Impl/TopDownParser.cs | 3 +- .../HydraScript.Domain.IR.csproj | 2 +- src/HydraScript/HydraScript.csproj | 2 +- ....Infrastructure.LexerRegexGenerator.csproj | 25 +++++ .../PatternGenerator.TokenTypes.cs | 49 ++++++++++ .../PatternGenerator.cs | 95 +++++++++++++++++++ .../Properties/launchSettings.json | 9 ++ .../GeneratedRegexContainer.cs | 11 +++ .../HydraScript.Infrastructure.csproj | 8 +- .../Logging/LoggingLexer.cs | 2 +- .../ServiceCollectionExtensions.cs | 3 +- .../StructureInstance.cs | 55 ----------- .../TokenTypesProvider.cs | 55 +++++++++++ ...structure.LexerRegexGenerator.Tests.csproj | 25 +++++ .../PatternGeneratorTests.cs | 71 ++++++++++++++ .../HydraScript.IntegrationTests.csproj | 3 +- .../HydraScript.Tests.csproj | 5 +- .../Unit/FrontEnd/RegexLexerTests.cs | 2 +- .../Unit/FrontEnd/StructureTests.cs | 31 +++--- .../Unit/FrontEnd/TopDownParserTests.cs | 2 +- .../GeneratedRegexContainerTests.cs | 13 +++ 39 files changed, 479 insertions(+), 153 deletions(-) create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/IGeneratedRegexContainer.cs create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/IStructure.cs create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITokenTypesProvider.cs create mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs delete mode 100644 src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj create mode 100644 src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/Properties/launchSettings.json create mode 100644 src/Infrastructure/HydraScript.Infrastructure/GeneratedRegexContainer.cs delete mode 100644 src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs create mode 100644 src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs create mode 100644 tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj create mode 100644 tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/PatternGeneratorTests.cs create mode 100644 tests/HydraScript.Tests/Unit/Infrastructure/GeneratedRegexContainerTests.cs diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 6ed212f5..2947a98e 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -37,6 +37,7 @@ jobs: run: dotnet build --no-restore -c Release -v n - name: Unit Tests run: | + dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj --no-build -v n dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Unit" mkdir coverage-report - name: Code Coverage Summary Report For Merge Request diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index d5eba20e..d1349190 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -88,6 +88,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Infrastructure" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.IntegrationTests", "tests\HydraScript.IntegrationTests\HydraScript.IntegrationTests.csproj", "{1CE98127-3027-4BD4-AAA3-63A589B09E73}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Infrastructure.LexerRegexGenerator", "src\Infrastructure\HydraScript.Infrastructure.LexerRegexGenerator\HydraScript.Infrastructure.LexerRegexGenerator.csproj", "{74D1495B-12A4-4E1A-ABE0-93029ECDC5FE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HydraScript.Infrastructure.LexerRegexGenerator.Tests", "tests\HydraScript.Infrastructure.LexerRegexGenerator.Tests\HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj", "{829111AD-4A5C-4B3D-AC28-208309CE10D6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -130,6 +134,14 @@ Global {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Debug|Any CPU.Build.0 = Debug|Any CPU {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Release|Any CPU.ActiveCfg = Release|Any CPU {1CE98127-3027-4BD4-AAA3-63A589B09E73}.Release|Any CPU.Build.0 = Release|Any CPU + {74D1495B-12A4-4E1A-ABE0-93029ECDC5FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74D1495B-12A4-4E1A-ABE0-93029ECDC5FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74D1495B-12A4-4E1A-ABE0-93029ECDC5FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74D1495B-12A4-4E1A-ABE0-93029ECDC5FE}.Release|Any CPU.Build.0 = Release|Any CPU + {829111AD-4A5C-4B3D-AC28-208309CE10D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {829111AD-4A5C-4B3D-AC28-208309CE10D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {829111AD-4A5C-4B3D-AC28-208309CE10D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {829111AD-4A5C-4B3D-AC28-208309CE10D6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {54CBE5A7-3C3E-44ED-B877-7B08A818083B} = {86CF2A2F-4DFE-48E7-B062-EF824730916A} @@ -147,5 +159,7 @@ Global {07DEA726-9772-4B61-AA66-1B82823F6BF0} = {A280C99E-0112-4F3C-A5E9-B793F2D9898E} {160B77ED-BA30-40A2-81EF-F5D1E4D22039} = {B7DDF6C9-B67C-430A-948A-A380EF68DEF1} {1CE98127-3027-4BD4-AAA3-63A589B09E73} = {3F131901-A9EC-451A-B7E9-726887CFE5FB} + {74D1495B-12A4-4E1A-ABE0-93029ECDC5FE} = {B7DDF6C9-B67C-430A-948A-A380EF68DEF1} + {829111AD-4A5C-4B3D-AC28-208309CE10D6} = {3F131901-A9EC-451A-B7E9-726887CFE5FB} EndGlobalSection EndGlobal diff --git a/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj b/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj index d2c705b4..492cf3bd 100644 --- a/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj +++ b/src/Application/HydraScript.Application.CodeGeneration/HydraScript.Application.CodeGeneration.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true diff --git a/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj b/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj index 823f0c2b..75c575c1 100644 --- a/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj +++ b/src/Application/HydraScript.Application.StaticAnalysis/HydraScript.Application.StaticAnalysis.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true diff --git a/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj index 605e1abc..7faaaf6b 100644 --- a/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj +++ b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true diff --git a/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj b/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj index 72fa726d..b7b4735b 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj +++ b/src/Domain/HydraScript.Domain.FrontEnd/HydraScript.Domain.FrontEnd.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IGeneratedRegexContainer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IGeneratedRegexContainer.cs new file mode 100644 index 00000000..4ab0599d --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IGeneratedRegexContainer.cs @@ -0,0 +1,8 @@ +using System.Text.RegularExpressions; + +namespace HydraScript.Domain.FrontEnd.Lexer; + +public interface IGeneratedRegexContainer +{ + public static abstract Regex GetRegex(); +} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs index 55d62136..bb694326 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ILexer.cs @@ -2,7 +2,7 @@ namespace HydraScript.Domain.FrontEnd.Lexer; public interface ILexer { - public Structure Structure { get; } + public IStructure Structure { get; } public List GetTokens(string text); } \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IStructure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IStructure.cs new file mode 100644 index 00000000..18217c1e --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/IStructure.cs @@ -0,0 +1,11 @@ +using System.Text.RegularExpressions; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; + +namespace HydraScript.Domain.FrontEnd.Lexer; + +public interface IStructure : IEnumerable +{ + public Regex Regex { get; } + + public TokenType FindByTag(string tag); +} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITokenTypesProvider.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITokenTypesProvider.cs new file mode 100644 index 00000000..ffca2d4e --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/ITokenTypesProvider.cs @@ -0,0 +1,8 @@ +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; + +namespace HydraScript.Domain.FrontEnd.Lexer; + +public interface ITokenTypesProvider +{ + IEnumerable GetTokenTypes(); +} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs index b31b66d4..14604bcb 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/RegexLexer.cs @@ -4,12 +4,12 @@ namespace HydraScript.Domain.FrontEnd.Lexer.Impl; -public class RegexLexer(Structure structure, ITextCoordinateSystemComputer computer) : ILexer, IEnumerable +public class RegexLexer(IStructure structure, ITextCoordinateSystemComputer computer) : ILexer, IEnumerable { private IReadOnlyList _lines = []; private string _text = ""; - public Structure Structure { get; } = structure; + public IStructure Structure { get; } = structure; public List GetTokens(string text) { diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs new file mode 100644 index 00000000..914b8ca7 --- /dev/null +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Diagnostics.CodeAnalysis; +using System.Text; +using System.Text.RegularExpressions; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; + +namespace HydraScript.Domain.FrontEnd.Lexer.Impl; + +public class Structure(ITokenTypesProvider provider) : IStructure + where TContainer : IGeneratedRegexContainer +{ + private Dictionary Types { get; } = provider.GetTokenTypes() + .Concat([new EndOfProgramType(), new ErrorType()]) + .ToDictionary(x => x.Tag); + + public Regex Regex { get; } = TContainer.GetRegex(); + + public TokenType FindByTag(string tag) => + Types[tag]; + + public override string ToString() => + new StringBuilder() + .AppendJoin('\n', this) + .ToString(); + + public IEnumerator GetEnumerator() => + Types.Values.GetEnumerator(); + + [ExcludeFromCodeCoverage] + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); +} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs deleted file mode 100644 index 0b5fc4b0..00000000 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Structure.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Collections; -using System.Diagnostics.CodeAnalysis; -using System.Text; -using System.Text.RegularExpressions; -using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; - -namespace HydraScript.Domain.FrontEnd.Lexer; - -public class Structure : IEnumerable -{ - public Structure(List types) - { - types.AddRange(new List - { - new EndOfProgramType(), - new ErrorType() - }); - types = types - .OrderBy(t => t.Priority) - .ToList(); - - Types = types - .ToDictionary(x => x.Tag, x => x); - - Regex = new Regex( - string.Join( - '|', - types - .Where(t => !t.EndOfProgram()) - .Select(t => t.GetNamedRegex()) - .ToList() - ) - ); - } - - private Dictionary Types { get; } - - public Regex Regex { get; } - - public TokenType FindByTag(string tag) => - Types[tag]; - - public override string ToString() => - new StringBuilder() - .AppendJoin('\n', - Types.Select(x => $"{x.Key} {x.Value.Pattern}") - ).ToString(); - - public IEnumerator GetEnumerator() => - Types.Values.GetEnumerator(); - - [ExcludeFromCodeCoverage] - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); -} \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs index 616b8ca0..864b8070 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/EndOfProgramType.cs @@ -1,6 +1,6 @@ namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -internal record EndOfProgramType() : TokenType("EOP", "", int.MaxValue - 1) +internal record EndOfProgramType() : TokenType(EopTag) { - public override bool EndOfProgram() => true; + public const string EopTag = "EOP"; } \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs index 90d28e9e..93c9de7d 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/ErrorType.cs @@ -1,6 +1,6 @@ namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -internal record ErrorType() : TokenType("ERROR", @"\S+", int.MaxValue) +internal record ErrorType() : TokenType("ERROR") { public override bool Error() => true; } \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs index 89c0fb74..810583c9 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/IgnorableType.cs @@ -1,7 +1,6 @@ namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -public record IgnorableType(string Tag, string Pattern, int Priority) - : TokenType(Tag, Pattern, Priority) +public record IgnorableType(string Tag) : TokenType(Tag) { public override bool CanIgnore() => true; } \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs index beeda930..90a81151 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypes/TokenType.cs @@ -1,14 +1,10 @@ namespace HydraScript.Domain.FrontEnd.Lexer.TokenTypes; -public record TokenType(string Tag, string Pattern, int Priority) +public record TokenType(string Tag) { public virtual bool CanIgnore() => false; - public virtual bool EndOfProgram() => false; - public virtual bool Error() => false; - public string GetNamedRegex() => $"(?<{Tag}>{Pattern})"; - - public override string ToString() => Tag; + public sealed override string ToString() => Tag; } \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs index 3cc6ebc7..97197054 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs @@ -1,7 +1,10 @@ +using System.Diagnostics.CodeAnalysis; + namespace HydraScript.Domain.FrontEnd.Lexer; public static class TokenTypesJson { + [StringSyntax(StringSyntaxAttribute.Json)] public const string String = """ [ diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs index 06f66457..bd9aad35 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Parser/Impl/TopDownParser.cs @@ -1,6 +1,7 @@ using System.Globalization; using System.Text.RegularExpressions; using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; using HydraScript.Domain.FrontEnd.Parser.Impl.Ast; using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes; using HydraScript.Domain.FrontEnd.Parser.Impl.Ast.Nodes.Declarations; @@ -26,7 +27,7 @@ public IAbstractSyntaxTree Parse(string text) _tokens = _lexer.GetTokens(text); var root = Script(); - Expect("EOP"); + Expect(EndOfProgramType.EopTag); return new AbstractSyntaxTree(root); } diff --git a/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj b/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj index 605e1abc..7faaaf6b 100644 --- a/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj +++ b/src/Domain/HydraScript.Domain.IR/HydraScript.Domain.IR.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true diff --git a/src/HydraScript/HydraScript.csproj b/src/HydraScript/HydraScript.csproj index b17edf89..4ac6db70 100644 --- a/src/HydraScript/HydraScript.csproj +++ b/src/HydraScript/HydraScript.csproj @@ -6,7 +6,7 @@ 1.2.6 enable enable - True + true diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj new file mode 100644 index 00000000..172aa6d1 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + enable + enable + true + + true + true + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + all + + + + diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs new file mode 100644 index 00000000..e166d3e7 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs @@ -0,0 +1,49 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace HydraScript.Infrastructure.LexerRegexGenerator; + +public partial class PatternGenerator +{ + private static readonly JsonSerializerOptions JsonSerializerOptions = new() + { + Converters = { new TokenTypesReadConverter() } + }; + + private record TokenType( + string Tag, + string Pattern, + int Priority) + { + public string GetNamedRegex() => $"(?<{Tag}>{Pattern})"; + } + + [ExcludeFromCodeCoverage] + private class TokenTypesReadConverter : JsonConverter> + { + public override IEnumerable Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options) + { + var root = JsonElement.ParseValue(ref reader); + var tokenTypes = root.EnumerateArray() + .Select(element => + { + var tag = element.GetProperty("tag").GetString()!; + var pattern = element.GetProperty("pattern").GetString()!; + var priority = element.GetProperty("priority").GetInt32(); + + return new TokenType(tag, pattern, priority); + }) + .OrderBy(x => x.Priority); + return tokenTypes; + } + + public override void Write( + Utf8JsonWriter writer, + IEnumerable value, + JsonSerializerOptions options) => throw new NotSupportedException(); + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs new file mode 100644 index 00000000..62f92022 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs @@ -0,0 +1,95 @@ +using System.Collections.Immutable; +using System.Text; +using System.Text.Json; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; + +namespace HydraScript.Infrastructure.LexerRegexGenerator; + +[Generator] +public partial class PatternGenerator : IIncrementalGenerator +{ + private const string AttributeSourceCode = @"// + +namespace HydraScript.Infrastructure; + +[System.AttributeUsage(System.AttributeTargets.Class)] +public class PatternContainerAttribute(string json) : System.Attribute + where T : HydraScript.Domain.FrontEnd.Lexer.IGeneratedRegexContainer +{ + public string Json { get; } = json; +} +"; + + public void Initialize(IncrementalGeneratorInitializationContext context) + { + context.RegisterPostInitializationOutput(ctx => ctx.AddSource( + "PatternContainerAttribute.g.cs", + SourceText.From(AttributeSourceCode, Encoding.UTF8))); + + var provider = context.SyntaxProvider + .ForAttributeWithMetadataName( + "HydraScript.Infrastructure.PatternContainerAttribute`1", + static (s, _) => IsSyntaxTargetForGeneration(s), + static (ctx, _) => GetTypeDeclarationForSourceGen(ctx)) + .Where(static x => x is not null) + .Select(static (x, _) => x!); + + context.RegisterImplementationSourceOutput(provider.Collect(), GenerateCode); + } + + private static bool IsSyntaxTargetForGeneration(SyntaxNode node) => + node is ClassDeclarationSyntax candidate && + candidate.Modifiers.Any(SyntaxKind.PartialKeyword) && + candidate.Modifiers.Any(SyntaxKind.InternalKeyword); + + private static RegexContainerInfo? GetTypeDeclarationForSourceGen( + GeneratorAttributeSyntaxContext context) + { + var attribute = context.Attributes.FirstOrDefault(); + if (attribute is null) + return null; + var visitable = (ClassDeclarationSyntax)context.TargetNode; + var json = attribute.ConstructorArguments.First().Value!.ToString()!; + return new RegexContainerInfo( + ClassName: visitable.Identifier.Text, + json); + } + + private static void GenerateCode( + SourceProductionContext context, + ImmutableArray containerInfos) + { + foreach (var info in containerInfos) + { + var tokenTypes = JsonSerializer.Deserialize>( + info.Json, + JsonSerializerOptions)! + .Concat([new TokenType("ERROR", @"\S+", int.MaxValue)]); + var pattern = string.Join('|', tokenTypes.Select(t => t.GetNamedRegex())); + + var code = $@"// + +using System.Diagnostics.CodeAnalysis; + +namespace HydraScript.Infrastructure; + +internal partial class {info.ClassName} +{{ + [StringSyntax(StringSyntaxAttribute.Regex)] + public const string Pattern = + """""" + {pattern} + """"""; +}} +"; + context.AddSource($"{info.ClassName}.g.cs", SourceText.From(code, Encoding.UTF8)); + } + } + + private record RegexContainerInfo( + string ClassName, + string Json); +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/Properties/launchSettings.json b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/Properties/launchSettings.json new file mode 100644 index 00000000..4d7712ba --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "profiles": { + "DebugRoslynSourceGenerator": { + "commandName": "DebugRoslynComponent", + "targetProject": "../HydraScript.Infrastructure/HydraScript.Infrastructure.csproj" + } + } +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/GeneratedRegexContainer.cs b/src/Infrastructure/HydraScript.Infrastructure/GeneratedRegexContainer.cs new file mode 100644 index 00000000..67df795e --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/GeneratedRegexContainer.cs @@ -0,0 +1,11 @@ +using System.Text.RegularExpressions; +using HydraScript.Domain.FrontEnd.Lexer; + +namespace HydraScript.Infrastructure; + +[PatternContainer(TokenTypesJson.String)] +internal partial class GeneratedRegexContainer : IGeneratedRegexContainer +{ + [GeneratedRegex("""(?[/]{2}.*)|(?[0-9]+[.][0-9]+)|(?[0-9]+)|(?null)|(?true|false)|(?\"(\\.|[^"\\])*\")|(?let|const|function|if|else|while|break|continue|return|as|type)|(?[+]{1,2}|[-]|[*]|[/]|[%]|([!]|[=])[=]|([<]|[>])[=]?|[!]|[|]{2}|[&]{2}|[~]|[:]{2})|(?[a-zA-Z][a-zA-Z0-9]*)|(?[?])|(?[:])|(?[;])|(?[=])|(?[,])|(?[{])|(?[}])|(?[(])|(?[)])|(?[.])|(?[[])|(?[]])|(?\S+)""")] + public static partial Regex GetRegex(); +} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj index 91b001c8..75844c02 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj +++ b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - True + true @@ -12,6 +12,12 @@ + + + + diff --git a/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs index 07606705..ccf98f5c 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs +++ b/src/Infrastructure/HydraScript.Infrastructure/Logging/LoggingLexer.cs @@ -13,7 +13,7 @@ internal class LoggingLexer( private readonly InputFile _inputFile = inputFile.Value; [ExcludeFromCodeCoverage] - public Structure Structure => lexer.Structure; + public IStructure Structure => lexer.Structure; public List GetTokens(string text) { diff --git a/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs b/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs index dc285de9..ca07aca8 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs +++ b/src/Infrastructure/HydraScript.Infrastructure/ServiceCollectionExtensions.cs @@ -18,7 +18,8 @@ public static class ServiceCollectionExtensions public static IServiceCollection AddDomain(this IServiceCollection services) { services.AddSingleton(); - services.AddSingleton(StructureInstance.Get); + services.AddSingleton(); + services.AddSingleton>(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs b/src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs deleted file mode 100644 index 91d138dd..00000000 --- a/src/Infrastructure/HydraScript.Infrastructure/StructureInstance.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.Json; -using System.Text.Json.Serialization; -using HydraScript.Domain.FrontEnd.Lexer; -using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; - -namespace HydraScript.Infrastructure; - -internal static class StructureInstance -{ - private static readonly JsonSerializerOptions JsonSerializerOptions = new() - { - Converters = { new StructureReadConverter() } - }; - - private static Structure? _instance; - public static Structure Get - { - get - { - _instance ??= JsonSerializer.Deserialize( - TokenTypesJson.String, - JsonSerializerOptions)!; - return _instance; - } - } - - [ExcludeFromCodeCoverage] - private class StructureReadConverter : JsonConverter - { - public override Structure Read(ref Utf8JsonReader reader, - Type typeToConvert, JsonSerializerOptions options) - { - using var jsonDocument = JsonDocument.ParseValue(ref reader); - var tokenTypes = jsonDocument.RootElement - .EnumerateArray().Select(element => - { - var tag = element.GetProperty("tag").GetString()!; - var pattern = element.GetProperty("pattern").GetString()!; - var priority = element.GetProperty("priority").GetInt32(); - - var ignorable = element.TryGetProperty("canIgnore", out var canIgnore); - - return ignorable && canIgnore.GetBoolean() - ? new IgnorableType(tag, pattern, priority) - : new TokenType(tag, pattern, priority); - }).ToList(); - return new Structure(tokenTypes); - } - - public override void Write(Utf8JsonWriter writer, - Structure value, JsonSerializerOptions options) => - throw new NotSupportedException(); - } -} \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs b/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs new file mode 100644 index 00000000..f6d61f07 --- /dev/null +++ b/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs @@ -0,0 +1,55 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json; +using System.Text.Json.Serialization; +using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; + +namespace HydraScript.Infrastructure; + +internal class TokenTypesProvider : ITokenTypesProvider +{ + private static readonly JsonSerializerOptions JsonSerializerOptions = new() + { + Converters = { new TokenTypesReadConverter() } + }; + + public IEnumerable GetTokenTypes() => + JsonSerializer.Deserialize>( + TokenTypesJson.String, + JsonSerializerOptions)!; + + [ExcludeFromCodeCoverage] + private class TokenTypesReadConverter : JsonConverter> + { + public override IEnumerable Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options) + { + var root = JsonElement.ParseValue(ref reader); + var tokenTypes = root.EnumerateArray() + .Select(element => + { + var tag = element.GetProperty("tag").GetString()!; + var priority = element.GetProperty("priority").GetInt32(); + + var ignorable = element.TryGetProperty("canIgnore", out var canIgnore); + + var tokenType = ignorable && canIgnore.GetBoolean() + ? new IgnorableType(tag) + : new TokenType(tag); + return new PrioritizedTokenType(tokenType, priority); + }) + .OrderBy(x => x.Priority) + .Select(x => x.TokenType); + return tokenTypes; + } + + public override void Write( + Utf8JsonWriter writer, + IEnumerable value, + JsonSerializerOptions options) => throw new NotSupportedException(); + + private record PrioritizedTokenType(TokenType TokenType, int Priority); + } +} \ No newline at end of file diff --git a/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj b/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj new file mode 100644 index 00000000..682db004 --- /dev/null +++ b/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + enable + enable + true + true + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/PatternGeneratorTests.cs b/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/PatternGeneratorTests.cs new file mode 100644 index 00000000..10840d0b --- /dev/null +++ b/tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/PatternGeneratorTests.cs @@ -0,0 +1,71 @@ +using System.Diagnostics; +using System.Reflection; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Xunit; + +namespace HydraScript.Infrastructure.LexerRegexGenerator.Tests; + +public class PatternGeneratorTests +{ + [Fact] + public void Initialize_PatternContainerMarked_CorrectlyGenerated() + { + var inputCompilation = CreateCompilation( + """ + using System.Text.RegularExpressions; + using HydraScript.Domain.FrontEnd.Lexer; + + namespace HydraScript.Infrastructure; + + [PatternContainer("[{ \"tag\": \"Number\", \"pattern\": \"[0-9]+\", \"priority\": 2 }, { \"tag\": \"Word\", \"pattern\": \"[a-zA-Z]+\", \"priority\": 1 }]")] + internal partial class TestPatternContainer : IGeneratedRegexContainer + { + public static Regex GetRegex() => throw new NotImplementedException(); + } + """); + + const string expectedSource = +"""" +// + +using System.Diagnostics.CodeAnalysis; + +namespace HydraScript.Infrastructure; + +internal partial class TestPatternContainer +{ + [StringSyntax(StringSyntaxAttribute.Regex)] + public const string Pattern = + """ + (?[a-zA-Z]+)|(?[0-9]+)|(?\S+) + """; +} + +""""; + + var generator = new PatternGenerator(); + GeneratorDriver driver = CSharpGeneratorDriver.Create(generator); + + driver = driver.RunGeneratorsAndUpdateCompilation(inputCompilation, out var outputCompilation, + out var diagnostics); + Debug.Assert(diagnostics.IsEmpty); + Debug.Assert(outputCompilation.SyntaxTrees.Count() == 3); + + var runResult = driver.GetRunResult(); + + var generatedFileSyntax = runResult.GeneratedTrees + .Single(t => t.FilePath.EndsWith("TestPatternContainer.g.cs")); + + Assert.Equal( + expectedSource, + generatedFileSyntax.GetText().ToString(), + ignoreLineEndingDifferences: true); + } + + private static CSharpCompilation CreateCompilation(string source) => + CSharpCompilation.Create("compilation", + new[] { CSharpSyntaxTree.ParseText(source) }, + new[] { MetadataReference.CreateFromFile(typeof(Binder).GetTypeInfo().Assembly.Location) }, + new CSharpCompilationOptions(OutputKind.ConsoleApplication)); +} \ No newline at end of file diff --git a/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj index b02729e6..beb70b16 100644 --- a/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj +++ b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj @@ -4,8 +4,7 @@ net8.0 enable enable - True - false + true true diff --git a/tests/HydraScript.Tests/HydraScript.Tests.csproj b/tests/HydraScript.Tests/HydraScript.Tests.csproj index 0b82692e..039cf30e 100644 --- a/tests/HydraScript.Tests/HydraScript.Tests.csproj +++ b/tests/HydraScript.Tests/HydraScript.Tests.csproj @@ -4,8 +4,7 @@ net8.0 enable enable - True - false + true true @@ -29,7 +28,7 @@ - + diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs index 76d6c12d..454921e2 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/RegexLexerTests.cs @@ -9,7 +9,7 @@ namespace HydraScript.Tests.Unit.FrontEnd; public class RegexLexerTests { private readonly RegexLexer _regexLexer = new( - StructureInstance.Get, + new Structure(new TokenTypesProvider()), new TextCoordinateSystemComputer()); [Theory] diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs index 1e8c0097..a9eb130c 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/StructureTests.cs @@ -1,5 +1,8 @@ using HydraScript.Domain.FrontEnd.Lexer; +using HydraScript.Domain.FrontEnd.Lexer.Impl; using HydraScript.Domain.FrontEnd.Lexer.TokenTypes; +using HydraScript.Infrastructure; +using Moq; using Xunit; namespace HydraScript.Tests.Unit.FrontEnd; @@ -11,20 +14,22 @@ public void ToStringCorrectTest() { var tokenTypes = new List { - new ("MyToken", "[m|M][y|Y]", 2), - new ("OneToSeven", "[1-7]", 1) + new("MyToken"), + new("OneToSeven") }; - var structure = new Structure(tokenTypes); + var provider = new Mock(); + provider.Setup(x => x.GetTokenTypes()) + .Returns(tokenTypes); + var structure = new Structure(provider.Object); - var expectedText = string.Join('\n', - new List - { - "OneToSeven [1-7]", - "MyToken [m|M][y|Y]", - "EOP ", - "ERROR \\S+" - } - ); - Assert.Equal(expectedText,structure.ToString()); + var expectedText = string.Join( + '\n', + [ + "MyToken", + "OneToSeven", + "EOP", + "ERROR" + ]); + Assert.Equal(expectedText, structure.ToString()); } } \ No newline at end of file diff --git a/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs b/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs index c27055f8..bd6bd31f 100644 --- a/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs +++ b/tests/HydraScript.Tests/Unit/FrontEnd/TopDownParserTests.cs @@ -10,7 +10,7 @@ namespace HydraScript.Tests.Unit.FrontEnd; public class TopDownParserTests { private readonly IParser _parser = new TopDownParser(new RegexLexer( - StructureInstance.Get, + new Structure(new TokenTypesProvider()), new TextCoordinateSystemComputer())); [Theory] diff --git a/tests/HydraScript.Tests/Unit/Infrastructure/GeneratedRegexContainerTests.cs b/tests/HydraScript.Tests/Unit/Infrastructure/GeneratedRegexContainerTests.cs new file mode 100644 index 00000000..895b5b8c --- /dev/null +++ b/tests/HydraScript.Tests/Unit/Infrastructure/GeneratedRegexContainerTests.cs @@ -0,0 +1,13 @@ +using HydraScript.Infrastructure; +using Xunit; + +namespace HydraScript.Tests.Unit.Infrastructure; + +public class GeneratedRegexContainerTests +{ + [Fact] + public void GetRegex_Generated_ManualIsUpToDate() => + GeneratedRegexContainer.Pattern.Trim().Should().Be( + GeneratedRegexContainer.GetRegex().ToString(), + "because В атрибут GeneratedRegex не подставлена актуальная сгенерированная регулярка"); +} \ No newline at end of file From 8bdd77a05319454406fe76bfd3667a9b6be9d96b Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 4 Aug 2024 16:03:21 +0300 Subject: [PATCH 20/35] upd cvrg info --- Readme.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Readme.md b/Readme.md index 4e56851b..31639cb5 100644 --- a/Readme.md +++ b/Readme.md @@ -1,15 +1,14 @@ -![Code Coverage](https://img.shields.io/badge/Code%20Coverage-41%25-critical?style=flat) - -| Package | Line Rate | Health | -|----------------------------------------|----------------------|--------| -| HydraScript | 0% | ❌ | -| HydraScript.Infrastructure | 31% | ❌ | -| HydraScript.Domain.BackEnd | 81% | ➖ | -| HydraScript.Application.CodeGeneration | 0% | ❌ | -| HydraScript.Domain.FrontEnd | 58% | ❌ | -| HydraScript.Application.StaticAnalysis | 4% | ❌ | -| HydraScript.Domain.IR | 74% | ❌ | -| **Summary** | **41%** (960 / 2358) | ❌ | +![Code Coverage](https://img.shields.io/badge/Code%20Coverage-47%25-critical?style=flat) + +| Package | Line Rate | Health | +|----------------------------------------|-----------------------|--------| +| HydraScript.Domain.BackEnd | 81% | ➖ | +| HydraScript.Infrastructure | 70% | ❌ | +| HydraScript.Domain.FrontEnd | 57% | ❌ | +| HydraScript.Domain.IR | 74% | ❌ | +| HydraScript.Application.CodeGeneration | 0% | ❌ | +| HydraScript.Application.StaticAnalysis | 4% | ❌ | +| **Summary** | **47%** (1325 / 2792) | ❌ | _Minimum allowed line rate is `80%`_ From 9f379c8a9a711b63d612ad79acb48b097af0609b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Mon, 5 Aug 2024 23:33:45 +0300 Subject: [PATCH 21/35] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=BD=D0=B0=20Source=20Gen=20Json=20(#80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #45 - тестовый workflow для проверки AOT publish на инфре GitHub Actions * #45 - перевёл бекенд на json source gen * fix * #45 - перевёл SG на json source gen * #45 - перевёл Infrastructure на json source gen * Revert "#45 - тестовый workflow для проверки AOT publish на инфре GitHub Actions" This reverts commit 3014c53de8d2deb1237254aa345ff514c52d3d05. --- ExtendedJavaScriptSubset.sln | 1 + samples/cycled.js | 8 ++++ .../HydraScript.Domain.BackEnd.csproj | 4 ++ .../Instructions/WithAssignment/AsString.cs | 29 ++++++++++----- ....Infrastructure.LexerRegexGenerator.csproj | 4 ++ .../PatternGenerator.TokenTypes.cs | 37 ++----------------- .../PatternGenerator.cs | 5 ++- .../HydraScript.Infrastructure.csproj | 4 ++ .../TokenTypesProvider.cs | 15 ++++---- .../HydraScript.IntegrationTests.csproj | 4 ++ .../SuccessfulProgramsTests.cs | 1 + 11 files changed, 58 insertions(+), 54 deletions(-) create mode 100644 samples/cycled.js diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index d1349190..523c309a 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -62,6 +62,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{04AB samples\this.js = samples\this.js samples\typeresolving.js = samples\typeresolving.js samples\vec2d.js = samples\vec2d.js + samples\cycled.js = samples\cycled.js EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{FB8F6EE1-1942-46D6-954E-9A1647BBDF10}" diff --git a/samples/cycled.js b/samples/cycled.js new file mode 100644 index 00000000..18ca8e85 --- /dev/null +++ b/samples/cycled.js @@ -0,0 +1,8 @@ +type CycledType = { + x: CycledType; +} +let obj: CycledType = { + x: null; +} +obj.x = obj +print(obj as string) \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj index 7faaaf6b..00c662bd 100644 --- a/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj +++ b/src/Domain/HydraScript.Domain.BackEnd/HydraScript.Domain.BackEnd.csproj @@ -7,4 +7,8 @@ true + + false + + diff --git a/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs index 83e74294..85bf6d0d 100644 --- a/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs +++ b/src/Domain/HydraScript.Domain.BackEnd/Impl/Instructions/WithAssignment/AsString.cs @@ -3,25 +3,34 @@ namespace HydraScript.Domain.BackEnd.Impl.Instructions.WithAssignment; -public class AsString(IValue value) : Simple(value) +public partial class AsString(IValue value) : Simple(value) { + private static readonly AsStringSerializationContext AsStringJsonContext = new(new JsonSerializerOptions + { + WriteIndented = true, + ReferenceHandler = ReferenceHandler.IgnoreCycles, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals + }); + public override IAddress Execute(IExecuteParams executeParams) { var frame = executeParams.Frames.Peek(); frame[Left!] = JsonSerializer.Serialize( - Right.right!.Get(frame), - new JsonSerializerOptions - { - WriteIndented = true, - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - ReferenceHandler = ReferenceHandler.IgnoreCycles, - NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals - } - ); + value: Right.right!.Get(frame)!, + AsStringJsonContext.Object); return Address.Next; } protected override string ToStringInternal() => $"{Left} = {Right.right} as string"; + + [JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(List))] + [JsonSerializable(typeof(Dictionary))] + [JsonSerializable(typeof(bool))] + [JsonSerializable(typeof(double))] + [JsonSerializable(typeof(string))] + private partial class AsStringSerializationContext : JsonSerializerContext; } \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj index 172aa6d1..57b3ef29 100644 --- a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/HydraScript.Infrastructure.LexerRegexGenerator.csproj @@ -22,4 +22,8 @@ + + false + + diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs index e166d3e7..c9fbd3ce 100644 --- a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.TokenTypes.cs @@ -1,16 +1,9 @@ -using System.Diagnostics.CodeAnalysis; -using System.Text.Json; using System.Text.Json.Serialization; namespace HydraScript.Infrastructure.LexerRegexGenerator; public partial class PatternGenerator { - private static readonly JsonSerializerOptions JsonSerializerOptions = new() - { - Converters = { new TokenTypesReadConverter() } - }; - private record TokenType( string Tag, string Pattern, @@ -19,31 +12,7 @@ private record TokenType( public string GetNamedRegex() => $"(?<{Tag}>{Pattern})"; } - [ExcludeFromCodeCoverage] - private class TokenTypesReadConverter : JsonConverter> - { - public override IEnumerable Read( - ref Utf8JsonReader reader, - Type typeToConvert, - JsonSerializerOptions options) - { - var root = JsonElement.ParseValue(ref reader); - var tokenTypes = root.EnumerateArray() - .Select(element => - { - var tag = element.GetProperty("tag").GetString()!; - var pattern = element.GetProperty("pattern").GetString()!; - var priority = element.GetProperty("priority").GetInt32(); - - return new TokenType(tag, pattern, priority); - }) - .OrderBy(x => x.Priority); - return tokenTypes; - } - - public override void Write( - Utf8JsonWriter writer, - IEnumerable value, - JsonSerializerOptions options) => throw new NotSupportedException(); - } + [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)] + [JsonSerializable(typeof(IEnumerable))] + private partial class PatternGeneratorContext : JsonSerializerContext; } \ No newline at end of file diff --git a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs index 62f92022..afab806c 100644 --- a/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs +++ b/src/Infrastructure/HydraScript.Infrastructure.LexerRegexGenerator/PatternGenerator.cs @@ -64,9 +64,10 @@ private static void GenerateCode( { foreach (var info in containerInfos) { - var tokenTypes = JsonSerializer.Deserialize>( + var tokenTypes = JsonSerializer.Deserialize( info.Json, - JsonSerializerOptions)! + PatternGeneratorContext.Default.IEnumerableTokenType)! + .OrderBy(x => x.Priority) .Concat([new TokenType("ERROR", @"\S+", int.MaxValue)]); var pattern = string.Join('|', tokenTypes.Select(t => t.GetNamedRegex())); diff --git a/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj index 75844c02..7056f88c 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj +++ b/src/Infrastructure/HydraScript.Infrastructure/HydraScript.Infrastructure.csproj @@ -28,4 +28,8 @@ + + false + + diff --git a/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs b/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs index f6d61f07..44bd978b 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs +++ b/src/Infrastructure/HydraScript.Infrastructure/TokenTypesProvider.cs @@ -6,17 +6,12 @@ namespace HydraScript.Infrastructure; -internal class TokenTypesProvider : ITokenTypesProvider +internal partial class TokenTypesProvider : ITokenTypesProvider { - private static readonly JsonSerializerOptions JsonSerializerOptions = new() - { - Converters = { new TokenTypesReadConverter() } - }; - public IEnumerable GetTokenTypes() => - JsonSerializer.Deserialize>( + JsonSerializer.Deserialize( TokenTypesJson.String, - JsonSerializerOptions)!; + TokenTypesProviderContext.Default.IEnumerableTokenType)!; [ExcludeFromCodeCoverage] private class TokenTypesReadConverter : JsonConverter> @@ -52,4 +47,8 @@ public override void Write( private record PrioritizedTokenType(TokenType TokenType, int Priority); } + + [JsonSourceGenerationOptions(Converters = [typeof(TokenTypesReadConverter)])] + [JsonSerializable(typeof(IEnumerable))] + private partial class TokenTypesProviderContext : JsonSerializerContext; } \ No newline at end of file diff --git a/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj index beb70b16..4136bb7e 100644 --- a/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj +++ b/tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj @@ -40,6 +40,10 @@ Samples\ceil.js Always + + Samples\cycled.js + Always + Samples\defaultarray.js Always diff --git a/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs b/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs index bce5ee2e..52f2f27a 100644 --- a/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs +++ b/tests/HydraScript.IntegrationTests/SuccessfulProgramsTests.cs @@ -24,6 +24,7 @@ public void Invoke_NoError_ReturnCodeIsZero(string fileName) "arraddremove.js", "arreditread.js", "ceil.js", + "cycled.js", "defaultarray.js", "equals.js", "exprtest.js", From 2b44c947f968f69d4139a27a6ebf472277989aa9 Mon Sep 17 00:00:00 2001 From: Stepami Date: Wed, 7 Aug 2024 23:38:15 +0300 Subject: [PATCH 22/35] =?UTF-8?q?=D0=90=D0=BA=D1=82=D1=83=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20Readme=20=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D0=B0=20=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B0=D1=82=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D1=85=D0=BE=D0=B4=D1=8F=D1=89=D0=B5=D0=B5=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 118 ++++++++++-------- .../Parser}/grammar.txt | 0 2 files changed, 66 insertions(+), 52 deletions(-) rename src/{HydraScript => Domain/HydraScript.Domain.FrontEnd/Parser}/grammar.txt (100%) diff --git a/Readme.md b/Readme.md index 31639cb5..6229da4d 100644 --- a/Readme.md +++ b/Readme.md @@ -18,14 +18,16 @@ _Minimum allowed line rate is `80%`_ За основу был взят стандарт [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) -[Лексическая структура](HydraScript/TokenTypes.cs) +[Лексическая структура](src/Domain/HydraScript.Domain.FrontEnd/Lexer/TokenTypesJson.cs) -[Грамматика](HydraScript/grammar.txt) +[Грамматика](src/Domain/HydraScript.Domain.FrontEnd/Parser/grammar.txt) [Рабочие примеры](samples) -### Цель проекта -Реализовать JavaScript с объектами и статической структурной типизацией, избавившись от таких понятий, как `constructor`, `class`, `interface` +### Цели проекта +1. Реализовать JavaScript с объектами и статической структурной типизацией, избавившись от таких понятий, как `constructor`, `class`, `interface` +2. Публично реверс-инжинирить современный статический анализ (вывод типов, форвард рефы, ошибки выполнения на стадии компиляции) +3. Упростить понимание области конструирования компиляторов за счёт исходного кода проекта - собрать понятные реализации алгоритмов и типовых задач в репозитории (Lexer, Parser, CFG, SSA, DCE, etc.) ### Конструкции языка @@ -43,17 +45,16 @@ _Minimum allowed line rate is `80%`_ - NullableType (тип, который допускает значение ```null```) - ObjectType (тип объекта, является NullableType) - ArrayType (списковый тип) -- FunctionType (тип функции) ##### Значения по умолчанию -| Тип | Значение | -| ----------- | ----------- | -| number | 0 | -| boolean | false | -|string| ""| -|NullableType|null| -|ArrayType|[]| +| Тип | Значение | +|--------------|----------| +| number | 0 | +| boolean | false | +| string | "" | +| NullableType | null | +| ArrayType | [] | ##### type alias Можно создать свой type alias по типу того, как это сделано в С++ @@ -65,10 +66,9 @@ type point = { x: int; y: int; } -type handleInts = (ints) => void -type handler = { - items: ints; - handle: handleInts; +type composite = { + p: point; + arr: ints; } ``` #### Объявление переменных @@ -77,18 +77,13 @@ let i = 1 // интерпретатор выведет тип из выраже let j: number // запишет значение по умолчанию в переменную let k: number = 1 // полностью явное объявление ``` +#### Функции + #### Объекты ``` let v2d = { - // обычное поле x: 3; y: 4; - //метод - lengthSquared => () { - // в методе доступны поля объекта - // и указатель this - return x * x + y * y - }; } ``` #### Списки @@ -99,18 +94,18 @@ array::1 // удаление элемента по индексу array = array ++ [5, 7] // конкатенация списков ``` #### Операторы -|Оператор|Вид|Типы операндов|Тип операции| -|---|---|---|---| -|+|бинарный|оба number, оба string|number, string -|*, -, /, %| бинарный|number|number -|||, && |бинарный|boolean|boolean -|!=, ==|бинарный|равный с двух сторон|boolean -|<=, >=, >, <|бинарный|number|boolean -|!|унарный|boolean|boolean -|-|унарный|number|number -|++|бинарный|[]|[] -|::|бинарный|[] и number|void -|~|унарный|[]|number +| Оператор | Вид | Типы операндов | Тип операции | +|------------------|----------|------------------------|----------------| +| + | бинарный | оба number, оба string | number, string | +| *, -, /, % | бинарный | number | number | +| ||, && | бинарный | boolean | boolean | +| !=, == | бинарный | равный с двух сторон | boolean | +| <=, >=, >, < | бинарный | number | boolean | +| ! | унарный | boolean | boolean | +| - | унарный | number | number | +| ++ | бинарный | [] | [] | +| :: | бинарный | [] и number | void | +| ~ | унарный | [] | number | #### Ветвление ``` @@ -148,6 +143,29 @@ function add(a: number, b: number): number { // вызов let c = add(1, 2) ``` +#### Методы +``` +// сделаны подобно Go - привязка по имени типа + +// шаг 1. Объявить type alias +type Point2 = { + x: number; + y: number; +} + +// шаг 2. Объявить переменную этого типа +let v2d: Point2 = { + x: 3; + y: 4; +} + +// шаг 3. Указать первым параметром функции - объект типа +function lengthSquared(obj: Point2) { + let x = obj.x + let y = obj.y + return x * x + y * y +} +``` #### Операции доступа ``` // объекты @@ -177,26 +195,22 @@ let s = v2d as string ### Запуск +Простой: +``` +HydraScript file.js ``` -HydraScript 1.2.6 -Copyright (C) 2024 HydraScript -USAGE: -Simple interpretation call: - HydraScript file.js -Request dump: - HydraScript --dump file.js - - -d, --dump (Default: false) Show dump data of interpreter - - --help Display this help screen. - - --version Display version information. - InputFilePath (pos. 0) Required. Path to input file +С выводом дебаг инфы (токены, ast, инструкции): +``` +HydraScript file.js --dump ``` ### Источники: -1. [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) -2. [DragonBook](https://suif.stanford.edu/dragonbook/) -3. [Stanford CS143 Lectures](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/) +1. Курсы "Конструирование Компиляторов" и "Генерация Оптимального Кода" кафедры ИУ-9 МГТУ им. Н.Э. Баумана +2. [ECMA-262](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/) +3. [DragonBook](https://suif.stanford.edu/dragonbook/) +4. [Stanford CS143 Lectures](https://web.stanford.edu/class/archive/cs/cs143/cs143.1128/) +5. [Simple Virtual Machine](https://github.com/parrt/simple-virtual-machine) +6. Ахо А., Ульман Дж. Теория синтаксического анализа, перевода и компиляции +7. Свердлов С.З. Языки программирования и методы трансляции \ No newline at end of file diff --git a/src/HydraScript/grammar.txt b/src/Domain/HydraScript.Domain.FrontEnd/Parser/grammar.txt similarity index 100% rename from src/HydraScript/grammar.txt rename to src/Domain/HydraScript.Domain.FrontEnd/Parser/grammar.txt From bffdaa4c9d33d5decdb54dbb6aa4e1cec2f80da5 Mon Sep 17 00:00:00 2001 From: Stepami Date: Thu, 8 Aug 2024 14:05:28 +0300 Subject: [PATCH 23/35] small fix - return exit code --- src/HydraScript/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HydraScript/Program.cs b/src/HydraScript/Program.cs index e6db4db8..cfbee1b9 100644 --- a/src/HydraScript/Program.cs +++ b/src/HydraScript/Program.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -GetRunner(ConfigureHost).Invoke(args); +return GetRunner(ConfigureHost).Invoke(args); public static partial class Program { From ba460d43d2135959dd158122f0ef72e57a0240ed Mon Sep 17 00:00:00 2001 From: Stepami Date: Fri, 9 Aug 2024 01:41:45 +0300 Subject: [PATCH 24/35] =?UTF-8?q?=D0=B2=D0=B0=D0=B6=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D1=83=D1=82=D0=BE=D1=87=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B2?= =?UTF-8?q?=20Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 6229da4d..aedf103b 100644 --- a/Readme.md +++ b/Readme.md @@ -25,7 +25,7 @@ _Minimum allowed line rate is `80%`_ [Рабочие примеры](samples) ### Цели проекта -1. Реализовать JavaScript с объектами и статической структурной типизацией, избавившись от таких понятий, как `constructor`, `class`, `interface` +1. Частично реализовать JavaScript с объектами и статической структурной типизацией, избавившись от таких понятий, как `constructor`, `class`, `interface` 2. Публично реверс-инжинирить современный статический анализ (вывод типов, форвард рефы, ошибки выполнения на стадии компиляции) 3. Упростить понимание области конструирования компиляторов за счёт исходного кода проекта - собрать понятные реализации алгоритмов и типовых задач в репозитории (Lexer, Parser, CFG, SSA, DCE, etc.) From 2171b59712d81aa55d8f264dd5779c4b70778381 Mon Sep 17 00:00:00 2001 From: Stepami Date: Fri, 9 Aug 2024 16:54:18 +0300 Subject: [PATCH 25/35] logo --- ExtendedJavaScriptSubset.sln | 1 + Readme.md | 4 ++++ hydrascript-logo.jpg | Bin 0 -> 133263 bytes 3 files changed, 5 insertions(+) create mode 100644 hydrascript-logo.jpg diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index 523c309a..7ece94ac 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt LICENSE = LICENSE Readme.md = Readme.md SECURITY.md = SECURITY.md + hydrascript-logo.jpg = hydrascript-logo.jpg EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolder", "{54CBE5A7-3C3E-44ED-B877-7B08A818083B}" diff --git a/Readme.md b/Readme.md index aedf103b..5c8710f9 100644 --- a/Readme.md +++ b/Readme.md @@ -12,6 +12,10 @@ _Minimum allowed line rate is `80%`_ +# HydraScript + +![logo](hydrascript-logo.jpg) + ## "Расширенное подмножество ЯП JavaScript" ### Вводная информация diff --git a/hydrascript-logo.jpg b/hydrascript-logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8404f728528dff98586d56fe9996d0cef1690712 GIT binary patch literal 133263 zcmeFa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/35] re-arrange --- Readme.md | 8 ++++---- hydrascript-logo.jpg | Bin 133263 -> 82222 bytes 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 5c8710f9..5c67160b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,7 @@ +# HydraScript + +![logo](hydrascript-logo.jpg) + ![Code Coverage](https://img.shields.io/badge/Code%20Coverage-47%25-critical?style=flat) | Package | Line Rate | Health | @@ -12,10 +16,6 @@ _Minimum allowed line rate is `80%`_ -# HydraScript - -![logo](hydrascript-logo.jpg) - ## "Расширенное подмножество ЯП JavaScript" ### Вводная информация diff --git a/hydrascript-logo.jpg b/hydrascript-logo.jpg index 8404f728528dff98586d56fe9996d0cef1690712..6eeba72ff7151cbe070ed9718458a7aa96f6e253 100644 GIT binary patch literal 82222 zcmeEv2|!Hy{`hH=HY1fKX(BD8B2uUhQmG^rvX4}fv??W;gAgf0Bt%0Y3S*C?p+yo> zNfg@m(o|E;OlQvgKjYqaukGIZe(!qs|K7XJHQnzy^F7P=^ZkDIR5YP1pVrPd;L=a>!A|Wyi5rdWp{D+9lLPVi04XvdSo{0FT^N7gW zQ>TT$B8mti`ldw%k%Zr6;n)Vgh)N6m5&k;xK`a7XoC1T~Jbe*F;*i)USPEfw^^o{4 z?W~x?pW0$GrXxs9%&+ZV;VP0S1myr+e_c=plMSZLoNPRE@(i^pGiD0^86n?0haeV6 z0OEo;A%RE`;)Zx4FcXNNMs}ICxjAK#qrIi|0t-L~1d*M;z|+T9bSQ#&`ve9!TFq5k zwtR(}l+DMy{~^-_a(aX7pbXz`P&~J z$-DXm1OnnLf}T^|+&8;IdpEQ<1qb>G&$FPdxXw%178T;5VgS4#v_}ft9zV4KqoL1F z?b*V%o41b}^bx+ZpPRRvu$=?#eOrRup)Ixm+IzQnx(7r16|~213i9@ZHV4{@-tI1& z5ky>w*W&}-T{l2`GPGp_7CV|l+XRS(tjA~Vb)U5Z-9z9#5yafrZ)9hT|-0R9DyiO^pK&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Jvfn5yjVqg~o myBOHTz%B-MF|dn)T@37EU>5_s7}&+YE(ZSn7})cB{67HHUxcjy From 3b88d54c18f86f61108ead6b304874ba79e6eadf Mon Sep 17 00:00:00 2001 From: Stepami Date: Fri, 9 Aug 2024 17:08:49 +0300 Subject: [PATCH 27/35] fix typo in logo --- hydrascript-logo.jpg | Bin 82222 -> 112603 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/hydrascript-logo.jpg b/hydrascript-logo.jpg index 6eeba72ff7151cbe070ed9718458a7aa96f6e253..9bec26dabc74b69dc25e2650e92fd24793dd1b68 100644 GIT binary patch literal 112603 zcmeEv1zc52*Y`ejcS}l1H`3h_0)m2obVzrHfOI3>h@eu^4blw)N(d?~oznFk!0Y9< z-sj%;{l4$_Z2aw6duCS5f2}n$d!K!dXQOA+NcW^gMIYQ&Qjn0A6$d~d06>zGHLFaR&e&(&D0|w%|_Z^v}ocFaVYW z07DE?w@FEVuKz9yUC+wK4gf&6!M)k^4Q%zmv@e)8bF{NMuipUESh}X?Gz8Q+Z38wC zOyix?Mwc}GMW0Jr=$zI!x6lXoIk(wL-(3HkZUNH)4)z9M8d4Ta`#G2xID+Z7V4A|r z-rNLC?}KS9a|0b)0DwX|ueUSMGX~SlU>eEhj*=*t<^upYB%>>|?iJe3zzJ+80Ek*z zIop^R8QYQG(4!$`;pXNdl`?QNGqAH`xUHjSs$-*1Dr#wNrDNd?0GDGv=K?U!u_XnA z%*n#d$;rUV2!{XL@u!X7di^SFx0U(vm-qRRnOAQ(%y#D)=EdufRy3aLHxHFub6ek4tga6LjxNF3$Q9x zaFm%?7=hhwp>JYmVrfBYV(~{F{+n!9Y&a(`;~Gq0W}O094;TToek=fTwFiL0L9?=H#b%eV*A;P#92FHR8Q;7bTw6C={|YEh*-qOfiL6{(X5DAD9LGa$^g9p6@jWiji64@0B8&}1zH4cfes-c zA&?-jAc!ESAebPyAcP@qLEM4RgfN1zhH!!Kg$RR)hscD;gD8h+gy@EN2Qdk;46y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F;<27aukD+|OQ!CdB zxDFAi3`;;)Idplmtf{!(ova;ZoquqDmf-?e+chSG!~a#G*z-)`b1NlH$lPSX($3eP7PrriVZ+){+0*$pK!uDvjG94>4}6j zn0RdreJp~8l8W}pmv*zp_EFCPLZAo0iM>iWpy=(xNyc#i9bmWwL_C8&R>J>Db!Y>` z`8$;FFjnAqpyPl&YxrM_gZcnm_i=-Jir(t8?-@2b9Wi*VtIV{eBqM_whQr}Ybdhf5 zB`vUFT5FC7mZV~7a_{p{tz@wOuJ?J8(NM@Rml1b%4_k)XZpH1<+MV**aUhx=u@2w- c7asC|<%RmMzxA&RUjOy1|Ia;Z)<1vzHxfe@XaE2J From 76991aa0fcc45447c8fbc97639962dc00644633d Mon Sep 17 00:00:00 2001 From: Georgy Levchenko <55885862+FoxTes@users.noreply.github.com> Date: Sun, 11 Aug 2024 14:52:47 +0400 Subject: [PATCH 28/35] Merge pull request #83 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Перейти на FrozenDictionary в Structure. * Убран пробел. * I have read the CLA Document and I hereby sign the CLA --- .../HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs index 914b8ca7..620708a0 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Collections.Frozen; using System.Diagnostics.CodeAnalysis; using System.Text; using System.Text.RegularExpressions; @@ -9,9 +10,9 @@ namespace HydraScript.Domain.FrontEnd.Lexer.Impl; public class Structure(ITokenTypesProvider provider) : IStructure where TContainer : IGeneratedRegexContainer { - private Dictionary Types { get; } = provider.GetTokenTypes() + private FrozenDictionary Types { get; } = provider.GetTokenTypes() .Concat([new EndOfProgramType(), new ErrorType()]) - .ToDictionary(x => x.Tag); + .ToFrozenDictionary(x => x.Tag); public Regex Regex { get; } = TContainer.GetRegex(); @@ -24,7 +25,7 @@ public override string ToString() => .ToString(); public IEnumerator GetEnumerator() => - Types.Values.GetEnumerator(); + Types.Values.AsEnumerable().GetEnumerator(); [ExcludeFromCodeCoverage] IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); From 4209e08f12566b4f015a671b6e91f9d4897b8b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sun, 11 Aug 2024 13:57:27 +0300 Subject: [PATCH 29/35] Remove cla (#85) * removed cla * fix --- .github/workflows/cla.yml | 29 ----------------- ExtendedJavaScriptSubset.sln | 2 -- contributor-licence-agreement.md | 31 ------------------- .../Lexer/Impl/Structure.cs | 1 + 4 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 .github/workflows/cla.yml delete mode 100644 contributor-licence-agreement.md diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml deleted file mode 100644 index 90c08059..00000000 --- a/.github/workflows/cla.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "CLA Assistant" -on: - issue_comment: - types: [created] - pull_request_target: - types: [opened,closed,synchronize] - -permissions: - actions: write - contents: write - pull-requests: write - statuses: write - -jobs: - CLAAssistant: - runs-on: ubuntu-latest - steps: - - name: "CLA Assistant" - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' - uses: contributor-assistant/github-action@v2.3.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - with: - path-to-signatures: 'signatures.json' - path-to-document: 'https://github.com/Stepami/hydrascript/blob/master/contributor-licence-agreement.md' - allowlist: Stepami,bot* - branch: 'main' - remote-repository-name: hydrascript-cla-signatures \ No newline at end of file diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index 7ece94ac..99cdfd74 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt .gitignore = .gitignore CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md CONTRIBUTING.md = CONTRIBUTING.md - contributor-licence-agreement.md = contributor-licence-agreement.md LICENSE = LICENSE Readme.md = Readme.md SECURITY.md = SECURITY.md @@ -23,7 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolde EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}" ProjectSection(SolutionItems) = preProject - .github\workflows\cla.yml = .github\workflows\cla.yml .github\workflows\develop.yml = .github\workflows\develop.yml .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection diff --git a/contributor-licence-agreement.md b/contributor-licence-agreement.md deleted file mode 100644 index 5297004e..00000000 --- a/contributor-licence-agreement.md +++ /dev/null @@ -1,31 +0,0 @@ -# HydraScript Individual Contributor License Agreement - -### *Adapted from http://www.apache.org/licenses/ © Apache Software Foundation.* - -In order to clarify the intellectual property license granted with Contributions from any person or entity, this project (HydraScript) must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This CLA is for your protection as a Contributor as well as the protection of HydraScript and its users; it does not change your rights to use your own Contributions for any other purpose. - -If you have not already done so, you will be requested to sign the CLA within the pull request by copy and pasting **"I have read the CLA Document and I hereby sign the CLA"** as a Pull Request comment. - -Please read this document carefully before signing and keep a copy for your records. - -You accept and agree to the following terms and conditions for your present and future Contributions Submitted to HydraScript. In return, HydraScript shall not use your Contributions in a way that is contrary to the public benefit or inconsistent with its nonprofit status and bylaws in effect at the time of the Contribution. Except for the license granted herein to HydraScript and recipients of software distributed by HydraScript, You reserve all right, title, and interest in and to your Contributions. - -1. Definitions. "You" (or "Contributor") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this CLA with HydraScript. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. - - For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally Submitted by You to HydraScript for inclusion in, or documentation of, any of the products owned or managed by HydraScript (the "Work"). For the purposes of this definition, "Submitted" means any form of electronic, verbal, or written communication sent to HydraScript or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, HydraScript for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution." - -2. Grant of Copyright License. Subject to the terms and conditions of this CLA, You hereby grant to HydraScript and to recipients of software distributed by HydraScript a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contributions and such derivative works. - -3. Grant of Patent License. Subject to the terms and conditions of this CLA, You hereby grant to HydraScript and to recipients of software distributed by HydraScript a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by your Contribution(s) alone or by combination of your Contribution(s) with the Work to which such Contribution(s) was Submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this CLA for that Contribution or Work shall terminate as of the date such litigation is filed. - -4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to HydraScript, or that your employer has executed a separate Corporate CLA with HydraScript. - -5. You represent that each of your Contributions is your original creation (see section 7 for submissions on behalf of others). You represent that your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of your Contributions. - -6. You are not expected to provide support for your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. - -7. You commit not to copy code from another project which license does not allow the duplication / reuse / modification of their source code and / or license is not compatible with the project you are contributing to. As a reminder, a project without an explicit license must be considered as a project with a copyrighted license. - -8. You agree to notify HydraScript of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect. \ No newline at end of file diff --git a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs index 620708a0..f082bfff 100644 --- a/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs +++ b/src/Domain/HydraScript.Domain.FrontEnd/Lexer/Impl/Structure.cs @@ -24,6 +24,7 @@ public override string ToString() => .AppendJoin('\n', this) .ToString(); + // ReSharper disable once NotDisposedResourceIsReturned public IEnumerator GetEnumerator() => Types.Values.AsEnumerable().GetEnumerator(); From 7ed2f61af2cbac53d34a64a175a0ea0502a25e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD?= Date: Sun, 11 Aug 2024 15:54:31 +0300 Subject: [PATCH 30/35] =?UTF-8?q?#48=20-=20=D0=B2=D0=BD=D0=B5=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20GitVersion=20(#86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * #48 - init GitVersion.yml * #48 - внедрение git-version в ci-cd * #48 - upload build * #48 - use version option * #48 - fix version * #48 - push builds only for dev * test * fix * fix * fix * fix * #48 - пуш тега на мерже в мастер * #48 - временное отключение релиз воркфлоу --- .github/workflows/develop.yml | 34 ++++++++++++++---- .../workflows/{release.yml => release.txt} | 0 ExtendedJavaScriptSubset.sln | 3 +- GitVersion.yml | 7 ++++ src/HydraScript/HydraScript.csproj | 1 - src/HydraScript/Program.cs | 13 ++++--- .../TestHostFixture.cs | 35 ++++++++++--------- 7 files changed, 63 insertions(+), 30 deletions(-) rename .github/workflows/{release.yml => release.txt} (100%) create mode 100644 GitVersion.yml diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 2947a98e..b29765c7 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -18,23 +18,39 @@ permissions: jobs: build-and-test: name: Build & Test - runs-on: ubuntu-latest + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - - name: Cache NuGet packages - uses: actions/cache@v4 + - name: Setup GitVersion + uses: gittools/actions/gitversion/setup@v3.0.0 + with: + versionSpec: '5.12.0' + - name: Determine Version + id: version_step + uses: gittools/actions/gitversion/execute@v3.0.0 with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj*') }} + useConfigFile: true + - name: Push New Version Tag + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + run: | + $gv = 'v${{ steps.version_step.outputs.majorMinorPatch }}' #gitversion result + $lt = $( git describe --tags --abbrev=0 ) # last tag version result + if ( -Not ( $gv -eq $lt ) ) + { + git tag $gv + git push origin --tags + } - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --no-restore -c Release -v n + run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Release -v n - name: Unit Tests run: | dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests/HydraScript.Infrastructure.LexerRegexGenerator.Tests.csproj --no-build -v n @@ -77,3 +93,9 @@ jobs: path: coverage-report - name: Integration Tests run: dotnet test -c Release --no-build -v n --filter="Category=Integration" + - name: Upload Windows Build + if: github.ref != 'refs/heads/master' && github.event_name == 'push' + uses: actions/upload-artifact@v4 + with: + name: windows_build_${{ steps.version_step.outputs.fullSemVer }} + path: ./src/HydraScript/bin/Release/net8.0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.txt similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/release.txt diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index 99cdfd74..cd41aebb 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionIt Readme.md = Readme.md SECURITY.md = SECURITY.md hydrascript-logo.jpg = hydrascript-logo.jpg + GitVersion.yml = GitVersion.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GithubFolder", "GithubFolder", "{54CBE5A7-3C3E-44ED-B877-7B08A818083B}" @@ -23,7 +24,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}" ProjectSection(SolutionItems) = preProject .github\workflows\develop.yml = .github\workflows\develop.yml - .github\workflows\release.yml = .github\workflows\release.yml + .github\workflows\release.txt = .github\workflows\release.txt EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplate", "IssueTemplate", "{0E31199C-4893-4920-A356-D1FF7850BFAD}" diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 00000000..d53da919 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,7 @@ +mode: Mainline +branches: + release: + increment: None +ignore: + sha: [] +merge-message-formats: {} diff --git a/src/HydraScript/HydraScript.csproj b/src/HydraScript/HydraScript.csproj index 4ac6db70..1d44d2d3 100644 --- a/src/HydraScript/HydraScript.csproj +++ b/src/HydraScript/HydraScript.csproj @@ -3,7 +3,6 @@ Exe net8.0 - 1.2.6 enable enable true diff --git a/src/HydraScript/Program.cs b/src/HydraScript/Program.cs index cfbee1b9..23e01587 100644 --- a/src/HydraScript/Program.cs +++ b/src/HydraScript/Program.cs @@ -13,11 +13,14 @@ public static partial class Program { public static readonly ExecuteCommand Command = new(); - public static Parser GetRunner(Action configureHost) => - new CommandLineBuilder(Command) - .UseHost(Host.CreateDefaultBuilder, configureHost) - .UseHelp() - .Build(); + public static Parser GetRunner(Action configureHost, bool useDefault = true) + { + var builder = new CommandLineBuilder(Command) + .UseHost(Host.CreateDefaultBuilder, configureHost); + if (useDefault) + builder = builder.UseDefaults(); + return builder.Build(); + } private static void ConfigureHost(IHostBuilder builder) => builder .ConfigureServices((context, services) => diff --git a/tests/HydraScript.IntegrationTests/TestHostFixture.cs b/tests/HydraScript.IntegrationTests/TestHostFixture.cs index eec77ca6..28dec4ae 100644 --- a/tests/HydraScript.IntegrationTests/TestHostFixture.cs +++ b/tests/HydraScript.IntegrationTests/TestHostFixture.cs @@ -14,23 +14,24 @@ public class TestHostFixture : IDisposable public Parser GetRunner(ITestOutputHelper testOutputHelper) => Program.GetRunner(configureHost: builder => builder - .ConfigureLogging(x => - { - x.ClearProviders(); - x.AddXUnit(testOutputHelper); - }) - .ConfigureServices((context, services) => - { - var parseResult = context.GetInvocationContext().ParseResult; - var fileInfo = parseResult.GetValueForArgument(Program.Command.PathArgument); - var dump = parseResult.GetValueForOption(Program.Command.DumpOption); - services - .AddDomain() - .AddApplication() - .AddInfrastructure(dump, fileInfo); - services.AddSingleton(Writer); - }) - .UseCommandHandler()); + .ConfigureLogging(x => + { + x.ClearProviders(); + x.AddXUnit(testOutputHelper); + }) + .ConfigureServices((context, services) => + { + var parseResult = context.GetInvocationContext().ParseResult; + var fileInfo = parseResult.GetValueForArgument(Program.Command.PathArgument); + var dump = parseResult.GetValueForOption(Program.Command.DumpOption); + services + .AddDomain() + .AddApplication() + .AddInfrastructure(dump, fileInfo); + services.AddSingleton(Writer); + }) + .UseCommandHandler(), + useDefault: false); public void Dispose() => Writer.Dispose(); } \ No newline at end of file From 9f15e48e45724cd464c7c0c41c797b04f54c0e68 Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 11 Aug 2024 16:06:58 +0300 Subject: [PATCH 31/35] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20codecov?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20master=20-=20=D0=B2=20=D0=BD=D1=91?= =?UTF-8?q?=D0=BC=20=D0=BD=D0=B5=D1=82=20=D1=81=D0=BC=D1=8B=D1=81=D0=BB?= =?UTF-8?q?=D0=B0,=20=D1=82=D0=B0=D0=BA=20=D0=BA=D0=B0=D0=BA=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B2=D1=81=D0=B5=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BD=D0=BE=20=D0=BF=D1=80=D0=BE=D0=B8=D1=81?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B8=D1=82=20=D1=80=D1=83=D0=BA=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8=20+semver:skip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index b29765c7..2a479616 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -69,17 +69,6 @@ jobs: link_missing_lines: true show_branch: true only_changed_files: true - - name: Code Coverage Summary Report For Master - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - uses: irongut/CodeCoverageSummary@v1.3.0 - with: - filename: ./tests/HydraScript.Tests/coverage.cobertura.xml - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: true - hide_complexity: true - thresholds: '80 100' - name: ReportGenerator uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 with: From 95ed127669d777e21eee77a1e2c57e802ed416b3 Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 11 Aug 2024 21:59:42 +0300 Subject: [PATCH 32/35] =?UTF-8?q?#48=20-=20=D0=B8=D1=81=D0=BA=D0=BB=D1=8E?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20release=20=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B8=D0=B7=20Develop=20Workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 2a479616..28509c3d 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -2,11 +2,11 @@ name: Develop Workflow on: push: - branches: - - '**' + branches-ignore: + - 'release' pull_request_target: - branches: - - '**' + branches-ignore: + - 'release' permissions: actions: write From 4f0b7c832a7cf1d821943bc883eee71f9f922560 Mon Sep 17 00:00:00 2001 From: Stepami Date: Sun, 11 Aug 2024 23:55:16 +0300 Subject: [PATCH 33/35] =?UTF-8?q?#48=20-=20=D0=B2=D0=B5=D1=80=D0=BD=D1=83?= =?UTF-8?q?=D0=BB=20release.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{release.txt => release.yml} | 4 ++-- ExtendedJavaScriptSubset.sln | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{release.txt => release.yml} (97%) diff --git a/.github/workflows/release.txt b/.github/workflows/release.yml similarity index 97% rename from .github/workflows/release.txt rename to .github/workflows/release.yml index 277f5c4d..eaff2186 100644 --- a/.github/workflows/release.txt +++ b/.github/workflows/release.yml @@ -2,8 +2,8 @@ name: Release Workflow on: push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + branches: + - 'release' jobs: create-release: diff --git a/ExtendedJavaScriptSubset.sln b/ExtendedJavaScriptSubset.sln index cd41aebb..3a42a319 100644 --- a/ExtendedJavaScriptSubset.sln +++ b/ExtendedJavaScriptSubset.sln @@ -24,7 +24,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}" ProjectSection(SolutionItems) = preProject .github\workflows\develop.yml = .github\workflows\develop.yml - .github\workflows\release.txt = .github\workflows\release.txt + .github\workflows\release.yml = .github\workflows\release.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplate", "IssueTemplate", "{0E31199C-4893-4920-A356-D1FF7850BFAD}" From 892c4a8563c86d9c46e5ac2cd704eef036a16e4a Mon Sep 17 00:00:00 2001 From: Stepami Date: Mon, 12 Aug 2024 00:15:04 +0300 Subject: [PATCH 34/35] =?UTF-8?q?#48=20-=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9?= =?UTF-8?q?=20Release=20Workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/develop.yml | 4 +- .github/workflows/release.yml | 76 ++++++++++++++++++++++++++--------- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 28509c3d..972f9188 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -3,10 +3,10 @@ name: Develop Workflow on: push: branches-ignore: - - 'release' + - 'release_test' pull_request_target: branches-ignore: - - 'release' + - 'release_test' permissions: actions: write diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eaff2186..0bf8230e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,41 +3,57 @@ name: Release Workflow on: push: branches: - - 'release' + - 'release_test' jobs: create-release: name: Create release runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} + outputs: + determined_version: ${{ steps.version_step.outputs.majorMinorPatch }} steps: - name: Checkout uses: actions/checkout@v4 - - name: Create release - id: create_release - uses: ncipollo/release-action@v1 + with: + fetch-depth: 0 + - name: Setup GitVersion + uses: gittools/actions/gitversion/setup@v3.0.0 + with: + versionSpec: '5.12.0' + - name: Determine Version + id: version_step + uses: gittools/actions/gitversion/execute@v3.0.0 + with: + useConfigFile: true + - name: Setup GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@v3.0.0 + with: + versionSpec: '0.18.x' + - name: Create release with GitReleaseManager + uses: gittools/actions/gitreleasemanager/create@v3.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} - + owner: 'Stepami' + repository: 'hydrascript' + milestone: 'v${{ steps.version_step.outputs.majorMinorPatch }}' + name: 'v${{ steps.version_step.outputs.majorMinorPatch }}' + upload-release-assets: name: Upload release assets needs: create-release + outputs: + determined_version: ${{ needs.create-release.outputs.determined_version }} strategy: matrix: config: - os: ubuntu-latest rid: linux-x64 - type: application/x-pie-executable - os: macos-latest rid: osx-x64 - type: application/x-mach-binary - os: macos-arm64-latest rid: osx-arm64 - type: application/x-mach-binary - os: windows-latest rid: win-x64 - type: application/x-dosexec runs-on: ${{ matrix.config.os }} steps: - name: Checkout @@ -46,16 +62,36 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x + - name: Setup GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@v3.0.0 + with: + versionSpec: '0.18.x' - name: Publish run: | mkdir output - dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded --self-contained false -o ./output - - name: Upload release assets - uses: shogo82148/actions-upload-release-asset@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_name: hydrascript-${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} - asset_path: ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} - asset_content_type: ${{ matrix.config.type }} + dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded -p:Version=${{ needs.create-release.outputs.determined_version }} --self-contained false -o ./output + - name: Add asset to a release with GitReleaseManager + uses: gittools/actions/gitreleasemanager/addasset@v3.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: 'Stepami' + repository: 'hydrascript' + milestone: 'v${{ needs.create-release.outputs.determined_version }}' + assets: ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} + publish-release: + name: Publish release + runs-on: ubuntu-latest + needs: upload-release-assets + steps: + - name: Setup GitReleaseManager + uses: gittools/actions/gitreleasemanager/setup@v3.0.0 + with: + versionSpec: '0.18.x' + - name: Publish release with GitReleaseManager + uses: gittools/actions/gitreleasemanager/publish@v3.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: 'Stepami' + repository: 'hydrascript' + milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}' \ No newline at end of file From 74618354095c20248bc3d1894684348c8d646d99 Mon Sep 17 00:00:00 2001 From: Stepami Date: Mon, 12 Aug 2024 00:23:25 +0300 Subject: [PATCH 35/35] fix --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bf8230e..6e5b344d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,9 +48,9 @@ jobs: config: - os: ubuntu-latest rid: linux-x64 - - os: macos-latest + - os: macos-12 rid: osx-x64 - - os: macos-arm64-latest + - os: macos-14 rid: osx-arm64 - os: windows-latest rid: win-x64