From b618fdf7b5295b190dcc6b7168e038d1d5a11455 Mon Sep 17 00:00:00 2001 From: Nitload Date: Sun, 20 Apr 2025 04:11:37 +0800 Subject: [PATCH] Daily update on 20250420-041137 by Nitload Youmu. Additional Message : Change: pipeline nodes use port to connect instead of connctors, this make send to multi-ports and recieve from multi-ports possible. Remove: Some types in Pipeline namepace removed sueto no need for connectors Signed-off-by: Nitload --- StgSharp.Common/Graphics/TexturePipeline.cs | 16 +- .../PipeLine/CrossFramePipelineNode.cs | 26 +- .../PipeLine/IConvertableToBlueprintNode.cs | 42 +-- StgSharp.Common/PipeLine/PipeLineRunner.cs | 97 +++--- StgSharp.Common/PipeLine/PipelineNodePort.cs | 157 +++++++++ .../PipelineScheduler.NodeCraeater.cs | 60 ++++ StgSharp.Common/PipeLine/PipelineScheduler.cs | 230 +++++++++++++ StgSharp.Common/PipeLine/PortArgs.cs | 126 +++++++ StgSharp.Common/PipeLine/SideNode.cs | 67 +--- StgSharp.Common/StateMachine.cs | 15 +- StgSharp.Common/StgSharp.Common.csproj | 4 - .../StgSharp.Common.csproj.nuget.dgspec.json | 1 - StgSharp.Common/obj/project.assets.json | 1 - .../net8.0/StgSharp.Common.AssemblyInfo.cs | 2 +- .../net8.0/StgSharp.Common.sourcelink.json | 2 +- ...tgSharp.Generator.csproj.nuget.dgspec.json | 1 - StgSharp.Generator/obj/project.assets.json | 1 - .../net8.0/StgSharp.Generator.AssemblyInfo.cs | 2 +- .../STEP/SyntaxNode/StepEntityInstanceNode.cs | 64 ++++ StgSharp.Model/StgSharp.Model.csproj | 4 + .../StgSharp.Model.csproj.nuget.dgspec.json | 3 - StgSharp.Model/obj/project.assets.json | 1 - .../net8.0/StgSharp.Model.AssemblyInfo.cs | 2 +- StgSharp.Script/Common/AbstractSyntaxTree.cs | 3 +- StgSharp.Script/Common/CompileStack.cs | 2 +- StgSharp.Script/Common/ISyntaxNode.cs | 69 ++++ .../Express/Builtin/ExpCollection.cs | 12 +- .../Express/Builtin/ExpCollectionInstance.cs | 11 +- StgSharp.Script/Express/Element/ExpConst.cs | 6 +- StgSharp.Script/Express/Element/ExpEntity.cs | 6 +- .../Express/Element/ExpFunction.cs | 6 +- .../Express/Element/ExpProcedureSource.cs | 4 +- StgSharp.Script/Express/Element/ExpRule.cs | 10 +- StgSharp.Script/Express/Element/ExpType.cs | 4 +- .../ExpAstNode/ExpBinaryOperatorNode.cs | 74 +++-- .../ExpAstNode/ExpCollectionIndexNode.cs | 23 +- .../ExpAstNode/ExpElementInitializingNode.cs | 10 +- .../ExpAstNode/ExpElementMemberNameNode.cs | 6 +- .../ExpAstNode/ExpFunctionCallingNode.cs | 16 +- .../Express/ExpAstNode/ExpIfNode.cs | 24 +- .../ExpAstNode/ExpInstanceMemberNode.cs | 8 +- .../ExpAstNode/ExpInstanceReferenceNode.cs | 6 +- .../Express/ExpAstNode/ExpMetaRefNode.cs | 17 +- .../ExpAstNode/ExpProcedureCallingNode.cs | 19 +- .../ExpAstNode/ExpProcedureControlNode.cs | 10 +- .../Express/ExpAstNode/ExpRepeatNode.cs | 46 +-- .../Express/ExpAstNode/ExpSwitchNode.cs | 35 +- .../ExpAstNode/ExpUnaryOperatorNode.cs | 31 +- .../Express/ExpAstNode/_ExpNode.cs | 32 +- StgSharp.Script/Express/ExpElementInstance.cs | 8 +- StgSharp.Script/Express/ExpElmentSource.cs | 24 +- StgSharp.Script/Express/ExpExceptions.cs | 2 +- .../Express/ExpNodeNextEnumerator.cs | 49 ++- StgSharp.Script/Express/ExpSourceReader.cs | 311 ++++++++++-------- .../Express/ExpSyntaxAnalyzer.CaseOf.cs | 13 +- .../Express/ExpSyntaxAnalyzer.Common.cs | 18 +- .../Express/ExpSyntaxAnalyzer.If.cs | 16 +- .../ExpSyntaxAnalyzer.OperatorParser.cs | 24 +- ...xpSyntaxAnalyzer.PrefixReverseAnalysing.cs | 4 +- .../Express/ExpSyntaxAnalyzer.RepeatLoop.cs | 30 +- StgSharp.Script/Express/ExpSyntaxAnalyzer.cs | 12 +- StgSharp.Script/Express/IExpMarshalType.cs | 2 +- .../StgSharp.Script.csproj.nuget.dgspec.json | 2 - StgSharp.Script/obj/project.assets.json | 1 - .../net8.0/StgSharp.Script.AssemblyInfo.cs | 2 +- .../net8.0/StgSharp.Script.sourcelink.json | 2 +- ....TerminalDialogue.csproj.nuget.dgspec.json | 1 - .../obj/project.assets.json | 1 - .../StgSharp.TerminalDialogue.AssemblyInfo.cs | 2 +- .../StgSharpDebug.csproj.nuget.dgspec.json | 4 - StgSharpDebug/obj/project.assets.json | 1 - .../net8.0/StgSharpDebug.AssemblyInfo.cs | 2 +- 72 files changed, 1343 insertions(+), 602 deletions(-) create mode 100644 StgSharp.Common/PipeLine/PipelineNodePort.cs create mode 100644 StgSharp.Common/PipeLine/PipelineScheduler.NodeCraeater.cs create mode 100644 StgSharp.Common/PipeLine/PipelineScheduler.cs create mode 100644 StgSharp.Common/PipeLine/PortArgs.cs create mode 100644 StgSharp.Model/STEP/SyntaxNode/StepEntityInstanceNode.cs create mode 100644 StgSharp.Script/Common/ISyntaxNode.cs diff --git a/StgSharp.Common/Graphics/TexturePipeline.cs b/StgSharp.Common/Graphics/TexturePipeline.cs index 6bfc4c68..4f4548a2 100644 --- a/StgSharp.Common/Graphics/TexturePipeline.cs +++ b/StgSharp.Common/Graphics/TexturePipeline.cs @@ -39,7 +39,7 @@ using System.Threading.Tasks; namespace StgSharp.Graphics { - public class TexturePipeline : PipeLineConnectorArgs + public class TexturePipeline : IPipeLineConnectionPayload { private Image _value; @@ -49,11 +49,19 @@ namespace StgSharp.Graphics _value = i; } - public new Image Value + public object? ValueDefault => null; + + public object Value { get => _value; - set => _value = value ?? - throw new ArgumentNullException( nameof( value ) ); + set + { + ArgumentNullException.ThrowIfNull( value ); + if( value is not Image image ) { + throw new ArgumentException( "Value must be of type Image" ); + } + _value = image; + } } } diff --git a/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs b/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs index 917d3874..379d0fa7 100644 --- a/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs +++ b/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs @@ -52,7 +52,7 @@ namespace StgSharp.PipeLine MainExecution = startup; this.cycleCount = ( cycleCount > 1 ) ? cycleCount : throw new ArgumentException( - $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(PipeLineNode).Name} instead."}" ); + $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(PipelineNode).Name} instead."}" ); this.cycleCount = cycleCount; currentCount = cycleCount; } @@ -63,28 +63,30 @@ namespace StgSharp.PipeLine private protected set => _mainExecution = value; } - public BlueprintNodeOperation Operation - { - get => ExecuteMain; - } - public IEnumerable InputInterfacesName => _inputName; public IEnumerable OutputInterfacesName => _outputName; - public void ExecuteMain( - in Dictionary input, - in Dictionary output ) + public PipelineNodeOperation Operation { - if( currentCount < cycleCount ) { + get => NodeMain; + } + + public void NodeMain( + in Dictionary input, + in Dictionary output ) + { + if( currentCount < cycleCount ) + { Interlocked.Increment( ref currentCount ); - } else { + } else + { Interlocked.Exchange( ref currentCount, 0 ); Task.Run( MainExecution ); } //Console.WriteLine(currentCount); - PipelineConnector.SkipAll( output ); + PipelineNodeExport.SkipAll( output ); } } diff --git a/StgSharp.Common/PipeLine/IConvertableToBlueprintNode.cs b/StgSharp.Common/PipeLine/IConvertableToBlueprintNode.cs index 5fe329db..b104485f 100644 --- a/StgSharp.Common/PipeLine/IConvertableToBlueprintNode.cs +++ b/StgSharp.Common/PipeLine/IConvertableToBlueprintNode.cs @@ -35,27 +35,22 @@ using System.Text; namespace StgSharp.PipeLine { - public delegate void BlueprintNodeOperation( - in Dictionary input, - in Dictionary output ); + public delegate void PipelineNodeOperation( + in Dictionary input, + in Dictionary output ); public interface IConvertableToBlueprintNode { - BlueprintNodeOperation Operation - { - get; - } + PipelineNodeOperation Operation { get; } - public IEnumerable InputInterfacesName - { - get; - } + public IEnumerable InputInterfacesName { get; } - public IEnumerable OutputInterfacesName - { - get; - } + public IEnumerable OutputInterfacesName { get; } + + void NodeMain( + in Dictionary input, + in Dictionary output ); } @@ -64,23 +59,30 @@ namespace StgSharp.PipeLine private string[] _input; private string[] _output; - private BlueprintNodeOperation _execution; + private PipelineNodeOperation _execution; public DefaultConvertableToBlueprintNode( - BlueprintNodeOperation execution, - string[] input, - string[] output ) + PipelineNodeOperation execution, + string[] input, + string[] output ) { _input = input; _output = output; _execution = execution; } - public BlueprintNodeOperation Operation => _execution; + public PipelineNodeOperation Operation => _execution; public IEnumerable InputInterfacesName => _input; public IEnumerable OutputInterfacesName => _output; + public void NodeMain( + in Dictionary input, + in Dictionary output ) + { + _execution.Invoke( input, output ); + } + } } diff --git a/StgSharp.Common/PipeLine/PipeLineRunner.cs b/StgSharp.Common/PipeLine/PipeLineRunner.cs index 1352c9d9..5ad3e64a 100644 --- a/StgSharp.Common/PipeLine/PipeLineRunner.cs +++ b/StgSharp.Common/PipeLine/PipeLineRunner.cs @@ -46,19 +46,17 @@ namespace StgSharp.PipeLine public static class PipeLineRunner { - private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray( - ); - private static CancellationTokenSource cts = new CancellationTokenSource( - ); - private static ConcurrentStack blueprintInWaiting - = new ConcurrentStack(); + private static NodeRunner[] allAvailableTask = CreateBlueprintRunnerArray(); + private static CancellationTokenSource cts = new CancellationTokenSource(); + private static ConcurrentStack blueprintInWaiting + = new ConcurrentStack(); private static int _callingThread; private static SemaphoreSlim bpLock = new SemaphoreSlim( 0, 1 ); /// - /// Only the following occasions of calling are valid: 1. no bp is - /// running or the only bp is quitting. 2. calling from the main thread or a - /// thread the current bp is running on. + /// Only the following occasions of calling are valid: 1. no bp is + /// running or the only bp is quitting.2. calling from the main thread or a + /// thread the current bp is running on. /// internal static bool IsValidCalling { @@ -66,18 +64,22 @@ namespace StgSharp.PipeLine { if( ( NodeRunner.CurrentBlueprint == null ) || //no bp running at all ( ( blueprintInWaiting.IsEmpty ) && ( NodeRunner.CurrentBlueprint.IsRunning == - false ) ) ) { + false ) ) ) + { // a bp is quitting //in case no bp is running return true; } int? id = Task.CurrentId; - if( id is null ) { + if( id is null ) + { // in case calling from main thread and current running bp return _callingThread == Environment.CurrentManagedThreadId; } - foreach( NodeRunner item in allAvailableTask ) { - if( item.Id == id ) { + foreach( NodeRunner item in allAvailableTask ) + { + if( item.Id == id ) + { //if calling from any bp running task return true; } @@ -86,25 +88,29 @@ namespace StgSharp.PipeLine } } - public static void Run( BlueprintScheduler blueprint ) + public static void Run( PipelineScheduler blueprint ) { //Console.WriteLine(); - if( blueprint == null ) { + if( blueprint == null ) + { return; } if( blueprint.IsRunning ) { - throw new InvalidOperationException( - "Attempt to run a blueprint instance twice." ); + throw new InvalidOperationException( "Attempt to run a blueprint instance twice." ); } - if( IsValidCalling ) { + if( IsValidCalling ) + { //Console.WriteLine("valid and run"); - if( InterruptAndRunNewBp( blueprint ) ) { + if( InterruptAndRunNewBp( blueprint ) ) + { while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { } ; } - } else { + } else + { bpLock.Wait(); - if( InterruptAndRunNewBp( blueprint ) ) { + if( InterruptAndRunNewBp( blueprint ) ) + { while( InterruptAndRunNewBp( NodeRunner.CurrentBlueprint ) ) { } } @@ -118,8 +124,10 @@ namespace StgSharp.PipeLine if( size < 1 ) { size = 1; } - if( allAvailableTask.Length >= size ) { - for( int i = size; i < allAvailableTask.Length; i++ ) { + if( allAvailableTask.Length >= size ) + { + for( int i = size; i < allAvailableTask.Length; i++ ) + { if( allAvailableTask[ i ] != null ) { allAvailableTask[ i ].Cancel(); } @@ -135,44 +143,47 @@ namespace StgSharp.PipeLine foreach( NodeRunner task in allAvailableTask ) { task.Cts.Cancel(); } - foreach( BlueprintScheduler bp in blueprintInWaiting ) { + foreach( PipelineScheduler bp in blueprintInWaiting ) { bp.Terminate(); } blueprintInWaiting.Clear(); } - internal static bool InterruptAndRunNewBp( BlueprintScheduler newBp ) + internal static bool InterruptAndRunNewBp( PipelineScheduler newBp ) { Debug.Assert( newBp != null ); - if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint != - null ) ) { + if( ( newBp != NodeRunner.CurrentBlueprint ) && ( NodeRunner.CurrentBlueprint != null ) ) + { //if a running bp exists blueprintInWaiting.Push( NodeRunner.CurrentBlueprint ); } //load new bp to current bp Interlocked.Exchange( ref NodeRunner.CurrentBlueprint!, newBp ); - Interlocked.Exchange( - ref _callingThread, Environment.CurrentManagedThreadId ); + Interlocked.Exchange( ref _callingThread, Environment.CurrentManagedThreadId ); //run beginning node to init it first. - if( !NodeRunner.CurrentBlueprint.IsRunning ) { - ( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run( - ); + if( !NodeRunner.CurrentBlueprint.IsRunning ) + { + ( NodeRunner.CurrentBlueprint.BeginLayer as BeginningNode )!.Run(); } //refresh all tasks - for( int i = 0; i < allAvailableTask.Length; i++ ) { + for( int i = 0; i < allAvailableTask.Length; i++ ) + { NodeRunner item = allAvailableTask[ i ]; if( ( item is null ) || item.IsCompleted ) { allAvailableTask[ i ] = NodeRunner.Run(); } } - PipeLineNode node; + PipelineNode node; while( !cts.Token.IsCancellationRequested && NodeRunner.CurrentBlueprint - .RequestNextNativeNode( out node ) ) { + .RequestNextNativeNode( + out node ) ) + { node.Run(); - if( !NodeRunner.CurrentBlueprint.IsRunning ) { + if( !NodeRunner.CurrentBlueprint.IsRunning ) + { break; } } @@ -191,7 +202,7 @@ namespace StgSharp.PipeLine internal class NodeRunner : CancellableTask { - private static BlueprintScheduler _current; + private static PipelineScheduler _current; internal NodeRunner() : base() @@ -199,14 +210,17 @@ namespace StgSharp.PipeLine _startup = InternalRun; } - internal static ref BlueprintScheduler CurrentBlueprint + internal static ref PipelineScheduler CurrentBlueprint { get => ref _current; } internal static NodeRunner Run() { - NodeRunner ret = new NodeRunner { _startup = InternalRun }; + NodeRunner ret = new NodeRunner + { + _startup = InternalRun + }; ret._internalTask = Task.Run( ret.InternalAction ); return ret; } @@ -214,9 +228,10 @@ namespace StgSharp.PipeLine private static void InternalRun( CancellationToken token ) { //Console.WriteLine("Task Begin"); - PipeLineNode item; + PipelineNode item; while( ( CurrentBlueprint != null ) && CurrentBlueprint.IsRunning && !token.IsCancellationRequested && CurrentBlueprint.RequestNexGlobalNode( - out item ) ) { + out item ) ) + { //Console.WriteLine($"Get node of {item.Name}, going to run."); item.Run(); } diff --git a/StgSharp.Common/PipeLine/PipelineNodePort.cs b/StgSharp.Common/PipeLine/PipelineNodePort.cs new file mode 100644 index 00000000..bb8c6859 --- /dev/null +++ b/StgSharp.Common/PipeLine/PipelineNodePort.cs @@ -0,0 +1,157 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PipelineNodePort.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.ExceptionServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.PipeLine +{ + public class PipelineNodeExport + { + + private HashSet _linkerSet = new HashSet(); + private SemaphoreSlim formerCompleteSemaphore; + + public PipelineNodeExport( PipelineNode container, string name ) + { + Container = container; + Name = name; + formerCompleteSemaphore = new SemaphoreSlim( initialCount: 0, maxCount: 1 ); + } + + public PipelineNode Container { get; init; } + + public SemaphoreSlim Waiter { get; init; } + + public string Name { get; init; } + + public void Connect( PipelineNodeImport port ) + { + ArgumentNullException.ThrowIfNull( port ); + if( _linkerSet.Add( port ) ) { + Container.Next.Add( port.Container ); + } + } + + public static void SkipAll( Dictionary ports ) + { + if( ports is null ) { + return; + } + foreach( PipelineNodeExport port in ports.Values ) { + port.Waiter.Release(); + } + } + + public void TransmitValue( IPipeLineConnectionPayload value ) + { + foreach( PipelineNodeImport item in _linkerSet ) { } + } + + public void WaitAll( IEnumerable ports ) + { + if( ports is null ) { + return; + } + foreach( PipelineNodeExport port in ports ) { + port.Waiter.Wait(); + } + } + + } + + public class PipelineNodeImport + { + + private HashSet _linkerSet = new HashSet(); + + public PipelineNodeImport( PipelineNode container, string name ) + { + Container = container; + Name = name; + } + + public IEnumerable LinkedPorts => _linkerSet; + + public PipelineNode Container { get; init; } + + public SemaphoreSlim Waiter { get; init; } + + public string Name { get; init; } + + public void Connect( PipelineNodeExport port ) + { + ArgumentNullException.ThrowIfNull( port ); + if( _linkerSet.Add( port ) ) { + Container.Previous.Add( port.Container ); + } + } + + public IEnumerator GetFormerNodes() + { + foreach( PipelineNodeExport port in _linkerSet ) { + yield return port.Container; + } + } + + public void Wait() + { + foreach( PipelineNodeExport connector in _linkerSet ) { + connector.Waiter.Wait(); + } + } + + public static void WaitAll( IDictionary ports ) + { + if( ports is null ) { + return; + } + foreach( PipelineNodeImport port in ports.Values ) { + port.Wait(); + } + } + + public static void WaitAll( IEnumerable ports ) + { + if( ports is null ) { + return; + } + foreach( PipelineNodeImport port in ports ) { + port.Wait(); + } + } + + } +} diff --git a/StgSharp.Common/PipeLine/PipelineScheduler.NodeCraeater.cs b/StgSharp.Common/PipeLine/PipelineScheduler.NodeCraeater.cs new file mode 100644 index 00000000..31310bf2 --- /dev/null +++ b/StgSharp.Common/PipeLine/PipelineScheduler.NodeCraeater.cs @@ -0,0 +1,60 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PipelineScheduler.NodeCraeater.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.PipeLine +{ + public partial class PipelineScheduler + { + + public PipelineNode CreateBlueprintNode( + string name, + PipelineNodeOperation operation, + string[] inputPort, + string[] outputPort, + bool isNative ) + { + PipelineNode node = new PipelineNode( operation, name, isNative, inputPort, + outputPort ); + if( isNative ) + { + mainThreadNodeList.Add( node ); + } else + { + globalNodeList.Add( node ); + } + return node; + } + + } +} diff --git a/StgSharp.Common/PipeLine/PipelineScheduler.cs b/StgSharp.Common/PipeLine/PipelineScheduler.cs new file mode 100644 index 00000000..b2878068 --- /dev/null +++ b/StgSharp.Common/PipeLine/PipelineScheduler.cs @@ -0,0 +1,230 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PipelineScheduler.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Stg; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Xml; +using System.Xml.Linq; + +namespace StgSharp.PipeLine +{ + /// + /// A sets of complex logic designed for running in multi threads environment. Warning: do not + /// run a instance in multi threads more than once. + /// + public partial class PipelineScheduler : IConvertableToBlueprintNode + { + + private BeginningNode _beginning; + private Dictionary allNode; + private EndingNode _ending; + + private List + _concurrentNodes = new List(), + _mainThreadNodes = new List(); + + private List globalNodeList; + private List mainThreadNodeList; + + private SemaphoreSlim runningStat; + + internal int currentGlobalNodeIndex; + internal int currentNativeNodeIndex; + + public PipelineScheduler() + { + allNode = new Dictionary(); + globalNodeList = new List(); + mainThreadNodeList = new List(); + runningStat = new SemaphoreSlim( 1, 1 ); + _beginning = new BeginningNode( this ); + _ending = new EndingNode( this ); + } + + public bool IsRunning + { + get => runningStat.CurrentCount == 0; + } + + public IEnumerable InputInterfacesName + { + get { return _beginning.OutputPorts.Keys; } + } + + public IEnumerable OutputInterfacesName + { + get { return _beginning.OutputPorts.Keys; } + } + + public PipelineNode BeginLayer => _beginning; + + public PipelineNode EndLayer => _ending; + + public PipelineNodeOperation Operation + { + get => ( this as IConvertableToBlueprintNode ).NodeMain; + } + + /**/ + + internal SemaphoreSlim RunningStat + { + get => runningStat; + } + /**/ + + public void AddNode( PipelineNode node, bool isNative ) + { + ArgumentNullException.ThrowIfNull( node ); + node.IsNative = isNative; + allNode.Add( node.Name, node ); + } + + public void ArrangeNodeOrder() + { + LinkedList _cache = new LinkedList(); + foreach( PipelineNode node in _beginning.Next ) + { + if( node.IsNative ) + { + _mainThreadNodes.Add( node ); + } else + { + _concurrentNodes.Add( node ); + } + foreach( PipelineNode item in node.Next ) + { + item.Previous.Remove( node ); + _cache.AddLast( item ); + } + } + while( _cache.Count > 0 ) + { + LinkedListNode begin = _cache.First!,current = begin,zero; + do + { + PipelineNode node = current.Value; + if( current.Value.Previous.Count == 0 ) + { + zero = current; + current = current.Next!; + if( node.IsNative ) + { + _mainThreadNodes.Add( node ); + } else + { + _concurrentNodes.Add( node ); + } + foreach( PipelineNode item in node.Next ) + { + item.Previous.Remove( node ); + _cache.AddLast( item ); + } + _cache.Remove( zero ); + } else + { + current = current.Next!; + } + } while (current.Next != begin); + } + } + + public void Init() + { + foreach( KeyValuePair item in allNode ) + { + if( item.Value.IsNative ) + { + mainThreadNodeList.Add( item.Value ); + } else + { + globalNodeList.Add( item.Value ); + } + } + mainThreadNodeList.Sort(); + globalNodeList.Sort(); + } + + [MethodImpl( MethodImplOptions.AggressiveInlining )] + public void SetInput( params (string name, IPipeLineConnectionPayload arg)[] parameters ) + { + _beginning.SetInputData( parameters ); + } + + public void Terminate() + { + Interlocked.Exchange( ref currentGlobalNodeIndex, int.MaxValue ); + Interlocked.Exchange( ref currentNativeNodeIndex, int.MaxValue ); + } + + internal bool RequestNexGlobalNode( out PipelineNode node ) + { + if( currentGlobalNodeIndex < globalNodeList.Count ) + { + node = globalNodeList[ currentGlobalNodeIndex ]; + Interlocked.Increment( ref currentGlobalNodeIndex ); + return true; + } + node = default!; + return false; + } + + internal bool RequestNextNativeNode( out PipelineNode node ) + { + if( currentNativeNodeIndex < mainThreadNodeList.Count ) + { + node = mainThreadNodeList[ currentNativeNodeIndex ]; + Interlocked.Increment( ref currentNativeNodeIndex ); + return true; + } + node = default!; + return false; + } + + void IConvertableToBlueprintNode.NodeMain( + in Dictionary input, + in Dictionary output ) + { + PipeLineRunner.Run( this ); + PipelineNodeExport.SkipAll( output ); + } + + ~PipelineScheduler() + { + runningStat.Dispose(); + } + + } +} diff --git a/StgSharp.Common/PipeLine/PortArgs.cs b/StgSharp.Common/PipeLine/PortArgs.cs new file mode 100644 index 00000000..59bfe99f --- /dev/null +++ b/StgSharp.Common/PipeLine/PortArgs.cs @@ -0,0 +1,126 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PortArgs.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Security.Authentication.ExtendedProtection; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.PipeLine +{ + public class PipelineConnector + { + + private protected IPipeLineConnectionPayload args; + private protected PipelineNodeExport input; + private protected PipelineNodeImport output; + private protected SemaphoreSlim formerCompleteSemaphore; + + public PipelineConnector( PipelineNodeExport former, PipelineNodeImport after ) + { + this.input = former; + this.output = after; + formerCompleteSemaphore = new SemaphoreSlim( initialCount: 0, maxCount: 1 ); + } + + public IPipeLineConnectionPayload Args + { + get => args; + set => args = value; + } + + public PipelineNodeExport Input => input; + + public PipelineNodeImport Output => output; + + public static void SkipAll( Dictionary ports ) + { + if( ports == null ) { + return; + } + foreach( KeyValuePair item in ports ) + { + if( item.Value != null ) { + item.Value.CompleteAndSkip(); + } + } + } + + public static void WaitAll( Dictionary ports ) + { + if( ports == null ) { + return; + } + foreach( KeyValuePair item in ports ) + { + if( item.Value != null ) { + item.Value.WaitForStart(); + } + } + } + + [MethodImpl( MethodImplOptions.AggressiveInlining )] + public virtual void WaitForStart() + { + //Console.WriteLine($"Waiting \t{input.ContextName}\t->\t{output.ContextName}"); + formerCompleteSemaphore.Wait(); + } + + ~PipelineConnector() + { + formerCompleteSemaphore.Dispose(); + } + + #region pipline op + + [MethodImpl( MethodImplOptions.AggressiveInlining )] + public void CompleteAndSkip() + { + //Console.WriteLine($"Complete\t{input.Name}\t->\t{output.Name}"); + formerCompleteSemaphore.Release(); + } + + [MethodImpl( MethodImplOptions.AggressiveInlining )] + public void CompleteAndWriteData( IPipeLineConnectionPayload args ) + { + this.args = args; + CompleteAndSkip(); + } + + #endregion + } + + public abstract class IPipeLineConnectionPayload { } +} diff --git a/StgSharp.Common/PipeLine/SideNode.cs b/StgSharp.Common/PipeLine/SideNode.cs index 952c8fcf..db85ae4c 100644 --- a/StgSharp.Common/PipeLine/SideNode.cs +++ b/StgSharp.Common/PipeLine/SideNode.cs @@ -33,93 +33,60 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Linq; +using System.Security.Principal; using System.Text; using System.Threading; using System.Threading.Tasks; namespace StgSharp.PipeLine { - internal sealed class BeginningNode : PipeLineNode + internal sealed class BeginningNode : PipelineNode { - private BlueprintScheduler _bp; + private PipelineScheduler _bp; - public BeginningNode( BlueprintScheduler bp ) - : base( - DefaultOperation, name: "BeginningNode", true, ["default"], - ["default"] ) + public BeginningNode( PipelineScheduler bp ) + : base( DefaultOperation, name: "BeginningNode", true, ["default"], ["default"] ) { _bp = bp; } - internal (string name, PipeLineConnectorArgs arg)[] InputData - { - set - { - if( value == null ) { - return; - } - foreach( (string name, PipeLineConnectorArgs arg) parameter in value ) { - OutputInterfaces[ parameter.name ].Args = parameter.arg; - } - } - } - public override void Run() { _bp.RunningStat.Wait(); - PipelineConnector.SkipAll( _outputInterfaces ); + PipelineNodeExport.SkipAll( _output ); } - public new void SetCertainOutputPort( - string name, - PipelineConnector pipeline ) + internal void SetInputData( IEnumerable<(string, IPipeLineConnectionPayload)> data ) { - if( _outputInterfaces.ContainsKey( name ) ) { - _outputInterfaces[ name ] = pipeline; + if( data is null ) { + return; + } + foreach( (string, IPipeLineConnectionPayload) item in data ) { + OutputPorts[ item.Item1 ].TransmitValue( item.Item2 ); } - _outputInterfaces.Add( name, pipeline ); } } - internal sealed class EndingNode : PipeLineNode + internal sealed class EndingNode : PipelineNode { - private BlueprintScheduler _bp; + private PipelineScheduler _bp; - public EndingNode( BlueprintScheduler bp ) - : base( - DefaultOperation, name: "EndingNode", true, ["default"], - ["default"] ) + public EndingNode( PipelineScheduler bp ) + : base( DefaultOperation, name: "EndingNode", true, ["default"], ["default"] ) { _bp = bp; } - internal (string name, PipeLineConnectorArgs arg)[] OutputData - { - get { return InputInterfaces.Select( - key => (key.Key, key.Value.Args) ) - .ToArray(); } - } - public override void Run() { - PipelineConnector.WaitAll( _inputInterfaces ); + PipelineNodeImport.WaitAll( _input ); Interlocked.Exchange( ref _bp.currentGlobalNodeIndex, 0 ); Interlocked.Exchange( ref _bp.currentNativeNodeIndex, 0 ); _bp.RunningStat.Release(); } - public new void SetCertainInputPort( - string name, - PipelineConnector pipeline ) - { - if( _inputInterfaces.ContainsKey( name ) ) { - _inputInterfaces[ name ] = pipeline; - } - _inputInterfaces.Add( name, pipeline ); - } - } } \ No newline at end of file diff --git a/StgSharp.Common/StateMachine.cs b/StgSharp.Common/StateMachine.cs index a3599e21..ba33ba53 100644 --- a/StgSharp.Common/StateMachine.cs +++ b/StgSharp.Common/StateMachine.cs @@ -39,10 +39,7 @@ namespace StgSharp public interface IStateMachine where T: Enum { - public T LastStableState - { - get; - } + public T LastStableState { get; } public bool TryEnterState(); @@ -56,15 +53,9 @@ namespace StgSharp where TState: Enum { - public bool IsInStabelState - { - get; - } + public bool IsInStabelState { get; } - public TState NextStableState - { - get; - } + public TState NextStableState { get; } public bool TrySwitchState(); diff --git a/StgSharp.Common/StgSharp.Common.csproj b/StgSharp.Common/StgSharp.Common.csproj index 1a35b2b2..34092131 100644 --- a/StgSharp.Common/StgSharp.Common.csproj +++ b/StgSharp.Common/StgSharp.Common.csproj @@ -83,10 +83,6 @@ - - - - diff --git a/StgSharp.Common/obj/StgSharp.Common.csproj.nuget.dgspec.json b/StgSharp.Common/obj/StgSharp.Common.csproj.nuget.dgspec.json index 644c7691..c8146cff 100644 --- a/StgSharp.Common/obj/StgSharp.Common.csproj.nuget.dgspec.json +++ b/StgSharp.Common/obj/StgSharp.Common.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Common/obj/project.assets.json b/StgSharp.Common/obj/project.assets.json index b384dd3d..1c3ce3fa 100644 --- a/StgSharp.Common/obj/project.assets.json +++ b/StgSharp.Common/obj/project.assets.json @@ -151,7 +151,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs index f31a02ce..c1038428 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2692495dc8460e1f60a2d073f162c5f526e1ba1b")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json index 2440bc0f..4b461246 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/2692495dc8460e1f60a2d073f162c5f526e1ba1b/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90/*"}} \ No newline at end of file diff --git a/StgSharp.Generator/obj/StgSharp.Generator.csproj.nuget.dgspec.json b/StgSharp.Generator/obj/StgSharp.Generator.csproj.nuget.dgspec.json index 67a3662e..c0e240d0 100644 --- a/StgSharp.Generator/obj/StgSharp.Generator.csproj.nuget.dgspec.json +++ b/StgSharp.Generator/obj/StgSharp.Generator.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Generator/obj/project.assets.json b/StgSharp.Generator/obj/project.assets.json index e932896f..905ec510 100644 --- a/StgSharp.Generator/obj/project.assets.json +++ b/StgSharp.Generator/obj/project.assets.json @@ -1083,7 +1083,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Generator/obj/x64/Debug/net8.0/StgSharp.Generator.AssemblyInfo.cs b/StgSharp.Generator/obj/x64/Debug/net8.0/StgSharp.Generator.AssemblyInfo.cs index 91e78c1b..010111f5 100644 --- a/StgSharp.Generator/obj/x64/Debug/net8.0/StgSharp.Generator.AssemblyInfo.cs +++ b/StgSharp.Generator/obj/x64/Debug/net8.0/StgSharp.Generator.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Generator")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2692495dc8460e1f60a2d073f162c5f526e1ba1b")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Generator")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Generator")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Model/STEP/SyntaxNode/StepEntityInstanceNode.cs b/StgSharp.Model/STEP/SyntaxNode/StepEntityInstanceNode.cs new file mode 100644 index 00000000..ebfb075a --- /dev/null +++ b/StgSharp.Model/STEP/SyntaxNode/StepEntityInstanceNode.cs @@ -0,0 +1,64 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="StepEntityInstanceNode.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Modeling.Step; +using StgSharp.Script; +using StgSharp.Script.Express; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Modeling.Step +{ + public class StepEntityInstanceNode : ExpSyntaxNode + { + + private int id; + private StepModel _model; + + public StepEntityInstanceNode( Token source, StepModel model ) : base( source ) { } + + public override ExpSyntaxNode Left => Empty; + + public override ExpSyntaxNode Right => Empty; + + public override IExpElementSource EqualityTypeConvert => throw new NotImplementedException(); + + private void GetInstance() + { + _model + + } + + } +} diff --git a/StgSharp.Model/StgSharp.Model.csproj b/StgSharp.Model/StgSharp.Model.csproj index 4147ac04..01aedcfb 100644 --- a/StgSharp.Model/StgSharp.Model.csproj +++ b/StgSharp.Model/StgSharp.Model.csproj @@ -12,4 +12,8 @@ + + + + diff --git a/StgSharp.Model/obj/StgSharp.Model.csproj.nuget.dgspec.json b/StgSharp.Model/obj/StgSharp.Model.csproj.nuget.dgspec.json index 25cc4599..9bb6f157 100644 --- a/StgSharp.Model/obj/StgSharp.Model.csproj.nuget.dgspec.json +++ b/StgSharp.Model/obj/StgSharp.Model.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -103,7 +102,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -176,7 +174,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Model/obj/project.assets.json b/StgSharp.Model/obj/project.assets.json index 247d010b..0910b062 100644 --- a/StgSharp.Model/obj/project.assets.json +++ b/StgSharp.Model/obj/project.assets.json @@ -1274,7 +1274,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs index a7df0221..2fbf6b9f 100644 --- a/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs +++ b/StgSharp.Model/obj/x64/Debug/net8.0/StgSharp.Model.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Model")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9457309c5ab188ce824a10ab60e572553986b6eb")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Model")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Model")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Script/Common/AbstractSyntaxTree.cs b/StgSharp.Script/Common/AbstractSyntaxTree.cs index f0089730..496c2f93 100644 --- a/StgSharp.Script/Common/AbstractSyntaxTree.cs +++ b/StgSharp.Script/Common/AbstractSyntaxTree.cs @@ -37,8 +37,7 @@ using System.Xml.Schema; namespace StgSharp.Script { - public sealed class AbstractSyntaxTree - where TNode: IASTNode + public sealed class AbstractSyntaxTree where TNode: ISyntaxNode where TType: ITypeSource { diff --git a/StgSharp.Script/Common/CompileStack.cs b/StgSharp.Script/Common/CompileStack.cs index 2df13343..ac3e595a 100644 --- a/StgSharp.Script/Common/CompileStack.cs +++ b/StgSharp.Script/Common/CompileStack.cs @@ -38,7 +38,7 @@ using System.Threading.Tasks; namespace StgSharp.Script { - public partial class CompileStack where TNode: IASTNode + public partial class CompileStack where TNode: ISyntaxNode where TType: ITypeSource { diff --git a/StgSharp.Script/Common/ISyntaxNode.cs b/StgSharp.Script/Common/ISyntaxNode.cs new file mode 100644 index 00000000..6f82f810 --- /dev/null +++ b/StgSharp.Script/Common/ISyntaxNode.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ISyntaxNode.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Collections; +using StgSharp.Script.Express; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace StgSharp.Script +{ + public interface ISyntaxNode where TNode: ISyntaxNode + where TType: ITypeSource + { + + long NodeFlag { get; } + + string CodeConvertTemplate { get; } + + TNode Previous { get; set; } + + TNode Next { get; set; } + + TNode Left { get; } + + TNode Right { get; } + + static abstract TNode Empty { get; } + + Token Source { get; } + + TType EqualityTypeConvert { get; } + + void AppendNode( TNode nextToken ); + + void PrependNode( TNode previusNode ); + + } +} diff --git a/StgSharp.Script/Express/Builtin/ExpCollection.cs b/StgSharp.Script/Express/Builtin/ExpCollection.cs index 9661beda..3a66ccb2 100644 --- a/StgSharp.Script/Express/Builtin/ExpCollection.cs +++ b/StgSharp.Script/Express/Builtin/ExpCollection.cs @@ -65,9 +65,9 @@ namespace StgSharp.Script.Express public abstract IEnumerator GetEnumerator(); - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } @@ -101,7 +101,7 @@ namespace StgSharp.Script.Express public override string Name => ExpressCompile.PoolString( "ARRAY" ); - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { throw new NotImplementedException(); } @@ -126,7 +126,7 @@ namespace StgSharp.Script.Express public override string Name => ExpressCompile.PoolString( "BAG" ); - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { throw new NotImplementedException(); } @@ -149,7 +149,7 @@ namespace StgSharp.Script.Express public override string Name => ExpressCompile.PoolString( "LIST" ); - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { throw new NotImplementedException(); } @@ -180,7 +180,7 @@ namespace StgSharp.Script.Express _collection.Add( token ); } - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { throw new NotImplementedException(); } diff --git a/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs b/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs index e69231e3..a0715763 100644 --- a/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs +++ b/StgSharp.Script/Express/Builtin/ExpCollectionInstance.cs @@ -34,7 +34,7 @@ using System.Text; namespace StgSharp.Script.Express { - public abstract class ExpCollectionInstanceBase : ExpNode + public abstract class ExpCollectionInstanceBase : ExpSyntaxNode { protected internal (int min, int max) _range; @@ -42,19 +42,16 @@ namespace StgSharp.Script.Express protected ExpCollectionInstanceBase( Token source ) : base( source ) { } - public abstract ExpCollectionBase CollectionValue - { - get; - } + public abstract ExpCollectionBase CollectionValue { get; } public ExpElementType MemberType { get => _memberType; } - public override ExpNode Left => null!; + public override ExpSyntaxNode Left => null!; - public override ExpNode Right => null!; + public override ExpSyntaxNode Right => null!; public int MinCapacity => _range.min; diff --git a/StgSharp.Script/Express/Element/ExpConst.cs b/StgSharp.Script/Express/Element/ExpConst.cs index 7e646993..ac15bba5 100644 --- a/StgSharp.Script/Express/Element/ExpConst.cs +++ b/StgSharp.Script/Express/Element/ExpConst.cs @@ -65,7 +65,7 @@ namespace StgSharp.Script.Express throw new NotImplementedException(); } - public override ExpNode MakeReference( params object[] options ) + public override ExpSyntaxNode MakeReference( params object[] options ) { if( options.Length == 0 || options[ 0 ] is not string str ) { return null!; @@ -84,14 +84,14 @@ namespace StgSharp.Script.Express return _constants.TryGetValue( name, out instance ); } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { if( _constants.TryGetValue( name, out ExpElementInstance? node ) ) { memberNode = node; return true; } - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } diff --git a/StgSharp.Script/Express/Element/ExpEntity.cs b/StgSharp.Script/Express/Element/ExpEntity.cs index 94b5a379..937ac379 100644 --- a/StgSharp.Script/Express/Element/ExpEntity.cs +++ b/StgSharp.Script/Express/Element/ExpEntity.cs @@ -37,7 +37,7 @@ namespace StgSharp.Script.Express public class ExpEntitySource : ExpInstantiableElement { - private AbstractSyntaxTree _expressionTree; + private AbstractSyntaxTree _expressionTree; private ScriptSourceTransmitter _source; private string _name; @@ -58,12 +58,12 @@ namespace StgSharp.Script.Express throw new NotImplementedException(); } - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { throw new NotImplementedException(); } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { throw new NotImplementedException(); } diff --git a/StgSharp.Script/Express/Element/ExpFunction.cs b/StgSharp.Script/Express/Element/ExpFunction.cs index 050629ff..5451e118 100644 --- a/StgSharp.Script/Express/Element/ExpFunction.cs +++ b/StgSharp.Script/Express/Element/ExpFunction.cs @@ -70,12 +70,12 @@ namespace StgSharp.Script.Express */ } - public override ExpNode MakeReference( params object[] options ) + public override ExpSyntaxNode MakeReference( params object[] options ) { throw new NotImplementedException(); } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { if( FuncParams.TryGetValue( name, out ExpElementInstance? param ) ) { @@ -87,7 +87,7 @@ namespace StgSharp.Script.Express memberNode = variable; return true; } - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } diff --git a/StgSharp.Script/Express/Element/ExpProcedureSource.cs b/StgSharp.Script/Express/Element/ExpProcedureSource.cs index 98c212cb..3d94a62b 100644 --- a/StgSharp.Script/Express/Element/ExpProcedureSource.cs +++ b/StgSharp.Script/Express/Element/ExpProcedureSource.cs @@ -50,12 +50,12 @@ namespace StgSharp.Script.Express throw new NotImplementedException(); } - public override ExpNode MakeReference( params object[] options ) + public override ExpSyntaxNode MakeReference( params object[] options ) { throw new NotImplementedException(); } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { throw new NotImplementedException(); } diff --git a/StgSharp.Script/Express/Element/ExpRule.cs b/StgSharp.Script/Express/Element/ExpRule.cs index e638f1e5..c89a3ac7 100644 --- a/StgSharp.Script/Express/Element/ExpRule.cs +++ b/StgSharp.Script/Express/Element/ExpRule.cs @@ -48,9 +48,9 @@ namespace StgSharp.Script.Express public override ExpInstantiableElement EqualityTypeConvert => throw new NotImplementedException( ); - public override ExpNode Left => throw new NotImplementedException(); + public override ExpSyntaxNode Left => throw new NotImplementedException(); - public override ExpNode Right => throw new NotImplementedException(); + public override ExpSyntaxNode Right => throw new NotImplementedException(); public override string TypeName => _source.Name; @@ -79,14 +79,14 @@ namespace StgSharp.Script.Express throw new NotImplementedException(); } - public override ExpNode MakeReference( params object[] options ) + public override ExpSyntaxNode MakeReference( params object[] options ) { throw new NotImplementedException(); } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } diff --git a/StgSharp.Script/Express/Element/ExpType.cs b/StgSharp.Script/Express/Element/ExpType.cs index 7fdb8f8a..16184033 100644 --- a/StgSharp.Script/Express/Element/ExpType.cs +++ b/StgSharp.Script/Express/Element/ExpType.cs @@ -87,9 +87,9 @@ namespace StgSharp.Script.Express return type == null || type == ExpVoidType.Only; } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpBinaryOperatorNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpBinaryOperatorNode.cs index 21615bde..fdb39a41 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpBinaryOperatorNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpBinaryOperatorNode.cs @@ -40,15 +40,15 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpBinaryOperatorNode : ExpNode + public class ExpBinaryOperatorNode : ExpSyntaxNode { private ExpInstantiableElement _returnType; - private ExpNode _left; - private ExpNode _right; + private ExpSyntaxNode _left; + private ExpSyntaxNode _right; - private ExpBinaryOperatorNode( Token source, ExpNode left, ExpNode right ) + private ExpBinaryOperatorNode( Token source, ExpSyntaxNode left, ExpSyntaxNode right ) : base( source ) { _left = left; @@ -57,11 +57,14 @@ namespace StgSharp.Script.Express public override ExpInstantiableElement EqualityTypeConvert => _returnType; - public override ExpNode Left => _left; + public override ExpSyntaxNode Left => _left; - public override ExpNode Right => _right; + public override ExpSyntaxNode Right => _right; - public static ExpBinaryOperatorNode Add( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode Add( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -77,7 +80,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode Assign( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode Assign( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( left.EqualityTypeConvert != right.EqualityTypeConvert ) { throw new ExpInvalidTypeException( @@ -93,8 +99,8 @@ namespace StgSharp.Script.Express public static ExpBinaryOperatorNode CompareInstanceEqual( Token source, - ExpNode left, - ExpNode right ) + ExpSyntaxNode left, + ExpSyntaxNode right ) { return new ExpBinaryOperatorNode( source, left, right ) { @@ -106,8 +112,8 @@ namespace StgSharp.Script.Express public static ExpBinaryOperatorNode CompareInstanceNotEqual( Token nsource, - ExpNode left, - ExpNode right ) + ExpSyntaxNode left, + ExpSyntaxNode right ) { return new ExpBinaryOperatorNode( nsource, left, right ) { @@ -119,8 +125,8 @@ namespace StgSharp.Script.Express public static ExpBinaryOperatorNode ConvertElement( Token source, - ExpNode left, - ExpNode right ) + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( right is not ExpMetaRefNode metaref ) { throw new ExpInvalidTypeException( @@ -138,7 +144,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode Div( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode Div( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -154,7 +163,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode EqualTo( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode EqualTo( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( left.EqualityTypeConvert != right.EqualityTypeConvert ) { throw new ExpInvalidTypeException( @@ -168,7 +180,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode GreaterThan( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode GreaterThan( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -181,7 +196,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode LessThan( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode LessThan( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -194,7 +212,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode Mul( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode Mul( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -210,7 +231,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode NotEqualTo( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode NotEqualTo( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( left.EqualityTypeConvert != right.EqualityTypeConvert ) { throw new ExpInvalidTypeException( @@ -224,7 +248,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode SmallerThan( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode SmallerThan( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); @@ -237,7 +264,10 @@ namespace StgSharp.Script.Express }; } - public static ExpBinaryOperatorNode Sub( Token source, ExpNode left, ExpNode right ) + public static ExpBinaryOperatorNode Sub( + Token source, + ExpSyntaxNode left, + ExpSyntaxNode right ) { if( !left.IsNumber && !right.IsNumber ) { throw new ExpInvalidTypeException( "Number", left.EqualityTypeConvert.Name ); diff --git a/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs index e89752da..47ac0c43 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs @@ -36,17 +36,17 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpCollectionIndexNode : ExpNode + public class ExpCollectionIndexNode : ExpSyntaxNode { private ExpCollectionInstanceBase _collection; - private ExpNode _indexExpression; + private ExpSyntaxNode _indexExpression; private ExpCollectionIndexNode( - Token source, - ExpCollectionInstanceBase instance, - ExpNode indexExpression ) + Token source, + ExpCollectionInstanceBase instance, + ExpSyntaxNode indexExpression ) : base( source ) { _collection = instance; @@ -54,23 +54,22 @@ namespace StgSharp.Script.Express CodeConvertTemplate = @"{0}[{1}]"; } - public override ExpNode Left => _collection; + public override ExpSyntaxNode Left => _collection; - public override ExpNode Right => _indexExpression; + public override ExpSyntaxNode Right => _indexExpression; public override IExpElementSource EqualityTypeConvert => _collection.EqualityTypeConvert; public static ExpCollectionIndexNode Create( - Token source, - ExpCollectionInstanceBase instance, - ExpNode indexExpression ) + Token source, + ExpCollectionInstanceBase instance, + ExpSyntaxNode indexExpression ) { if( !indexExpression.IsNumber ) { throw new ExpInvalidTypeException( "Number", indexExpression.EqualityTypeConvert.Name ); } - return new ExpCollectionIndexNode( - source, instance, indexExpression ); + return new ExpCollectionIndexNode( source, instance, indexExpression ); } } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpElementInitializingNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpElementInitializingNode.cs index d391bb72..0a076b36 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpElementInitializingNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpElementInitializingNode.cs @@ -36,25 +36,25 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpElementInitializingNode : ExpNode + public class ExpElementInitializingNode : ExpSyntaxNode { private ExpMetaRefNode _type; - private ExpNode _init; + private ExpSyntaxNode _init; public ExpElementInitializingNode( Token source, ExpMetaRefNode type, - ExpNode initParameter ) + ExpSyntaxNode initParameter ) : base( source ) { _type = type; _init = initParameter; } - public override ExpNode Left => _type; + public override ExpSyntaxNode Left => _type; - public override ExpNode Right => _init; + public override ExpSyntaxNode Right => _init; public override IExpElementSource EqualityTypeConvert => _type.SourceRef; diff --git a/StgSharp.Script/Express/ExpAstNode/ExpElementMemberNameNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpElementMemberNameNode.cs index 9275c01c..5936d4ce 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpElementMemberNameNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpElementMemberNameNode.cs @@ -36,7 +36,7 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpElementMemberNameNode : ExpNode + public class ExpElementMemberNameNode : ExpSyntaxNode { internal ExpElementMemberNameNode( Token source ) @@ -46,9 +46,9 @@ namespace StgSharp.Script.Express CodeConvertTemplate = source.Value; } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => Empty; + public override ExpSyntaxNode Right => Empty; public override IExpElementSource EqualityTypeConvert { diff --git a/StgSharp.Script/Express/ExpAstNode/ExpFunctionCallingNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpFunctionCallingNode.cs index eb4a2b1b..ad48078f 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpFunctionCallingNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpFunctionCallingNode.cs @@ -36,31 +36,33 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpFunctionCallingNode : ExpNode + public class ExpFunctionCallingNode : ExpSyntaxNode { private ExpFunctionSource _function; - private ExpNode _parameter; + private ExpSyntaxNode _parameter; private ExpFunctionCallingNode( Token source, ExpFunctionSource function, - ExpNode firstParameter ) + ExpSyntaxNode firstParameter ) : base( source ) { _function = function; _parameter = firstParameter; } + public ExpFunctionSource FunctionCaller => _function; + public override ExpInstantiableElement EqualityTypeConvert => throw new NotImplementedException( ); - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => _parameter; + public override ExpSyntaxNode Right => _parameter; - public void AppendParameter( ExpNode parameter ) + public void AppendParameter( ExpSyntaxNode parameter ) { _parameter.AppendNode( parameter ); } @@ -68,7 +70,7 @@ namespace StgSharp.Script.Express public static ExpFunctionCallingNode CallFunction( Token source, ExpFunctionSource function, - ExpNode param ) + ExpSyntaxNode param ) { return new ExpFunctionCallingNode( source, function, param ); } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpIfNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpIfNode.cs index 2c53424b..6eea568d 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpIfNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpIfNode.cs @@ -36,14 +36,14 @@ using System.Text; namespace StgSharp.Script.Express { - public sealed class ExpIfNode : ExpNode + public sealed class ExpIfNode : ExpSyntaxNode { - private ExpNode _falseOpBegin; - private ExpNode _rule; - private ExpNode _trueOpBegin ; + private ExpSyntaxNode _falseOpBegin; + private ExpSyntaxNode _rule; + private ExpSyntaxNode _trueOpBegin ; - public ExpIfNode( Token source, ExpNode rule, ExpNode trueOpBegin ) + public ExpIfNode( Token source, ExpSyntaxNode rule, ExpSyntaxNode trueOpBegin ) : base( source ) { _rule = rule; @@ -59,9 +59,9 @@ namespace StgSharp.Script.Express public ExpIfNode( Token source, - ExpNode rule, - ExpNode rootOperationIfTrue, - ExpNode rootOperationIfFalse ) + ExpSyntaxNode rule, + ExpSyntaxNode rootOperationIfTrue, + ExpSyntaxNode rootOperationIfFalse ) : base( source ) { _rule = rule; @@ -78,18 +78,18 @@ namespace StgSharp.Script.Express """ ); } - public override ExpNode Left => _trueOpBegin; + public override ExpSyntaxNode Left => _trueOpBegin; - public override ExpNode Right => _falseOpBegin; + public override ExpSyntaxNode Right => _falseOpBegin; public override IExpElementSource EqualityTypeConvert => null!; - public void AppendFalseOperation( ExpNode expressionRoot ) + public void AppendFalseOperation( ExpSyntaxNode expressionRoot ) { _falseOpBegin.AppendNode( expressionRoot ); } - public void AppendTrueOperation( ExpNode expressionRoot ) + public void AppendTrueOperation( ExpSyntaxNode expressionRoot ) { _trueOpBegin.AppendNode( expressionRoot ); } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpInstanceMemberNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpInstanceMemberNode.cs index 19d817ad..7c5d3299 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpInstanceMemberNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpInstanceMemberNode.cs @@ -38,12 +38,12 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpInstanceMemberNode : ExpNode + public class ExpInstanceMemberNode : ExpSyntaxNode { private ExpElementInstance _instance; private ExpElementMemberNameNode _memberName; - private ExpNode _member; + private ExpSyntaxNode _member; public ExpInstanceMemberNode( Token source, @@ -56,9 +56,9 @@ namespace StgSharp.Script.Express _instance.TryGetMember( memberName.CodeConvertTemplate, out _member ); } - public override ExpNode Left => _instance; + public override ExpSyntaxNode Left => _instance; - public override ExpNode Right => _memberName; + public override ExpSyntaxNode Right => _memberName; public override IExpElementSource EqualityTypeConvert => _member.EqualityTypeConvert; diff --git a/StgSharp.Script/Express/ExpAstNode/ExpInstanceReferenceNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpInstanceReferenceNode.cs index 770b621f..c634772c 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpInstanceReferenceNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpInstanceReferenceNode.cs @@ -37,7 +37,7 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpInstanceReferenceNode : ExpNode + public class ExpInstanceReferenceNode : ExpSyntaxNode { internal ExpInstanceReferenceNode( Token source, ExpElementInstance instance ) @@ -58,9 +58,9 @@ namespace StgSharp.Script.Express public ExpElementInstance OriginObject { get ; private set; } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => Empty; + public override ExpSyntaxNode Right => Empty; public override IExpElementSource EqualityTypeConvert => OriginObject.EqualityTypeConvert; diff --git a/StgSharp.Script/Express/ExpAstNode/ExpMetaRefNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpMetaRefNode.cs index e279fe72..9e9ff7ca 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpMetaRefNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpMetaRefNode.cs @@ -38,26 +38,29 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpMetaRefNode : ExpNode + public class ExpMetaRefNode : ExpSyntaxNode { - internal ExpMetaRefNode( Token source, ExpInstantiableElement element ) : base( source ) + internal ExpMetaRefNode( Token source, ExpInstantiableElement element ) + : base( source ) { SourceRef = element; } public ExpInstantiableElement SourceRef { get; init; } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => Empty; + public override ExpSyntaxNode Right => Empty; public override IExpElementSource EqualityTypeConvert => ExpInstantiableElement.Void; public static ExpMetaRefNode RefEntity( Token position, ExpEntitySource entity ) { if( position.Value != entity.Name ) { - throw new ExpCompileException( position, $"Meta data does not match, name of source to match is {entity.Name}, but token is {position.Value}" ); + throw new ExpCompileException( + position, + $"Meta data does not match, name of source to match is {entity.Name}, but token is {position.Value}" ); } ExpMetaRefNode node = new ExpMetaRefNode( position, entity ) { @@ -69,7 +72,9 @@ namespace StgSharp.Script.Express public static ExpMetaRefNode RefType( Token position, ExpTypeSource type ) { if( position.Value != type.Name ) { - throw new ExpCompileException( position, $"Meta data does not match, name of source to match is {type.Name}, but token is {position.Value}" ); + throw new ExpCompileException( + position, + $"Meta data does not match, name of source to match is {type.Name}, but token is {position.Value}" ); } ExpMetaRefNode node = new ExpMetaRefNode( position, type ) { diff --git a/StgSharp.Script/Express/ExpAstNode/ExpProcedureCallingNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpProcedureCallingNode.cs index 00039990..cf7b06b6 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpProcedureCallingNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpProcedureCallingNode.cs @@ -37,30 +37,33 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpProcedureCallingNode : ExpNode + public class ExpProcedureCallingNode : ExpSyntaxNode { - private ExpNode _params; + private ExpSyntaxNode _params; - public ExpProcedureCallingNode( Token source, ExpProcedureSource caller, ExpNode param ) + public ExpProcedureCallingNode( + Token source, + ExpProcedureSource caller, + ExpSyntaxNode param ) : base( source ) { _params = param; CalledProcedure = caller; } - public override ExpNode Left => Empty; - - public override ExpNode Right => _params; - public ExpProcedureSource CalledProcedure { get; init; } + public override ExpSyntaxNode Left => Empty; + + public override ExpSyntaxNode Right => _params; + public override IExpElementSource EqualityTypeConvert => ExpInstantiableElement.Void; public static ExpProcedureCallingNode CallProcedure( Token postion, ExpProcedureSource caller, - ExpNode input ) + ExpSyntaxNode input ) { ExpProcedureCallingNode node = new ExpProcedureCallingNode( postion, caller, input ) { diff --git a/StgSharp.Script/Express/ExpAstNode/ExpProcedureControlNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpProcedureControlNode.cs index 67a4ba07..4c4878a0 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpProcedureControlNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpProcedureControlNode.cs @@ -40,20 +40,20 @@ using ExpKeyword = StgSharp.Script.Express.ExpressCompile.Keyword; namespace StgSharp.Script.Express { - public class ExpProcedureControlNode : ExpNode + public class ExpProcedureControlNode : ExpSyntaxNode { - private ExpNode _additional; + private ExpSyntaxNode _additional; internal ExpProcedureControlNode( Token source ) : base( source ) { } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => _additional; + public override ExpSyntaxNode Right => _additional; public override IExpElementSource EqualityTypeConvert => ExpTypeSource.Void; - public static ExpProcedureControlNode Return( Token t, ExpNode valueToReturn ) + public static ExpProcedureControlNode Return( Token t, ExpSyntaxNode valueToReturn ) { if( t.Value != ExpKeyword.Return ) { throw new InvalidCastException(); diff --git a/StgSharp.Script/Express/ExpAstNode/ExpRepeatNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpRepeatNode.cs index 1fc52867..3d4018f5 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpRepeatNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpRepeatNode.cs @@ -37,21 +37,21 @@ using System.Threading.Channels; namespace StgSharp.Script.Express { - public class ExpRepeatNode : ExpNode + public class ExpRepeatNode : ExpSyntaxNode { private ExpElementInstance _variable; - private ExpNode _begin, _end, _increment, _operationBegin,_untilRule,_whileRule; + private ExpSyntaxNode _begin, _end, _increment, _operationBegin,_untilRule,_whileRule; internal ExpRepeatNode( Token source, ExpElementInstance variable, - ExpNode begin, - ExpNode end, - ExpNode increment, - ExpNode operationBegin, - ExpNode untilRule, - ExpNode whileRule ) + ExpSyntaxNode begin, + ExpSyntaxNode end, + ExpSyntaxNode increment, + ExpSyntaxNode operationBegin, + ExpSyntaxNode untilRule, + ExpSyntaxNode whileRule ) : base( source ) { if( variable.NodeFlag != begin.NodeFlag || begin.NodeFlag != end.NodeFlag || ( increment != @@ -90,13 +90,13 @@ namespace StgSharp.Script.Express _whileRule = whileRule; } - public override ExpNode Left => throw new NotImplementedException(); + public override ExpSyntaxNode Left => throw new NotImplementedException(); - public override ExpNode Right => _operationBegin; + public override ExpSyntaxNode Right => _operationBegin; public override IExpElementSource EqualityTypeConvert => null!; - public void AppendRepeatedOperation( ExpNode node ) + public void AppendRepeatedOperation( ExpSyntaxNode node ) { _operationBegin.AppendNode( node ); } @@ -126,12 +126,12 @@ namespace StgSharp.Script.Express public static ExpRepeatNode Create( Token t, ExpInstanceReferenceNode repeatVariable, - ExpNode begin, - ExpNode end, - ExpNode increment, - ExpNode whileRule, - ExpNode untilRule, - ExpNode body ) + ExpSyntaxNode begin, + ExpSyntaxNode end, + ExpSyntaxNode increment, + ExpSyntaxNode whileRule, + ExpSyntaxNode untilRule, + ExpSyntaxNode body ) { untilRule = ExpBoolNode.False( null ); whileRule = ExpBoolNode.True( null ); @@ -163,12 +163,12 @@ namespace StgSharp.Script.Express public static ExpRepeatNode Create( Token t, ExpElementInstance repeatVariable, - ExpNode begin, - ExpNode end, - ExpNode increment, - ExpNode whileRule, - ExpNode untilRule, - ExpNode body ) + ExpSyntaxNode begin, + ExpSyntaxNode end, + ExpSyntaxNode increment, + ExpSyntaxNode whileRule, + ExpSyntaxNode untilRule, + ExpSyntaxNode body ) { whileRule = IsNullOrEmpty( whileRule ) ? ExpBoolNode.True( t ) : whileRule; untilRule = IsNullOrEmpty( untilRule ) ? ExpBoolNode.False( t ) : untilRule; diff --git a/StgSharp.Script/Express/ExpAstNode/ExpSwitchNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpSwitchNode.cs index 5ba30f9b..baa47f64 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpSwitchNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpSwitchNode.cs @@ -35,25 +35,26 @@ using System.Text; namespace StgSharp.Script.Express { - public class ExpSwitchNode : ExpNode + public class ExpSwitchNode : ExpSyntaxNode { - private ExpNode _default; - private ExpNode _target; + private ExpSyntaxNode _default; + private ExpSyntaxNode _target; - private FrozenDictionary _cases; + private FrozenDictionary _cases; public ExpSwitchNode( Token source, - ExpNode target, - ExpNode defaultCase, - params (ExpNode label, ExpNode op)[] cases ) + ExpSyntaxNode target, + ExpSyntaxNode defaultCase, + params (ExpSyntaxNode label, ExpSyntaxNode op)[] cases ) : base( source ) { _target = target; _default = defaultCase; - Dictionary casesDic = new Dictionary(); - foreach( (ExpNode label, ExpNode op ) item in cases ) + Dictionary casesDic = new Dictionary( + ); + foreach( (ExpSyntaxNode label, ExpSyntaxNode op ) item in cases ) { if( item.op == null ) { @@ -84,9 +85,9 @@ namespace StgSharp.Script.Express public ExpSwitchNode( Token source, - ExpNode target, - ExpNode defaultCase, - IDictionary cases ) + ExpSyntaxNode target, + ExpSyntaxNode defaultCase, + IDictionary cases ) : base( source ) { _target = target; @@ -109,24 +110,24 @@ namespace StgSharp.Script.Express CodeConvertTemplate = codeFormatBuilder.ToString(); } - public ExpNode this[ ExpNode index ] + public ExpSyntaxNode this[ ExpSyntaxNode index ] { get { - if( _cases.TryGetValue( index, out ExpNode? ret ) ) { + if( _cases.TryGetValue( index, out ExpSyntaxNode? ret ) ) { return ret; } return _default; } } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => Empty; + public override ExpSyntaxNode Right => Empty; public override IExpElementSource EqualityTypeConvert => null!; - public bool ContainsCase( ExpNode token ) + public bool ContainsCase( ExpSyntaxNode token ) { return _cases.ContainsKey( token ); } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs index 3b4961a3..63101d30 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpUnaryOperatorNode.cs @@ -36,35 +36,29 @@ using System.Threading.Tasks; namespace StgSharp.Script.Express { - public class ExpUnaryOperatorNode : ExpNode + public class ExpUnaryOperatorNode : ExpSyntaxNode { - private ExpNode _operand; + private ExpSyntaxNode _operand; private ExpUnaryOperatorNode( Token source ) : base( source ) { } - public ExpUnaryOperatorNode( - Token source, - ExpNode operand, - ExpSchema context ) + public ExpUnaryOperatorNode( Token source, ExpSyntaxNode operand, ExpSchema context ) : base( source ) { _operand = operand; } - public override ExpNode Left => null!; + public override ExpSyntaxNode Left => null!; - public override ExpNode Right => _operand; + public override ExpSyntaxNode Right => _operand; public override IExpElementSource EqualityTypeConvert => _operand.EqualityTypeConvert; - public static ExpUnaryOperatorNode UnaryMinus( - Token source, - ExpNode operand ) + public static ExpUnaryOperatorNode UnaryMinus( Token source, ExpSyntaxNode operand ) { if( !operand.IsNumber ) { - throw new ExpInvalidTypeException( - "Number", operand.EqualityTypeConvert.Name ); + throw new ExpInvalidTypeException( "Number", operand.EqualityTypeConvert.Name ); } bool isFloat = ( operand._nodeFlag | ExpNodeFlag.BuiltinType_Real ) == 0; @@ -75,9 +69,7 @@ namespace StgSharp.Script.Express }; } - public static ExpUnaryOperatorNode UnaryNot( - Token source, - ExpNode operand ) + public static ExpUnaryOperatorNode UnaryNot( Token source, ExpSyntaxNode operand ) { if( ( operand._nodeFlag | ( ExpNodeFlag.BuiltinType_Logic | ExpNodeFlag.BuiltinType_Logic ) ) == 0 ) { @@ -91,13 +83,10 @@ namespace StgSharp.Script.Express }; } - public static ExpUnaryOperatorNode UnaryPlus( - Token source, - ExpNode operand ) + public static ExpUnaryOperatorNode UnaryPlus( Token source, ExpSyntaxNode operand ) { if( !operand.IsNumber ) { - throw new ExpInvalidTypeException( - "Number", operand.EqualityTypeConvert.Name ); + throw new ExpInvalidTypeException( "Number", operand.EqualityTypeConvert.Name ); } bool isFloat = ( operand._nodeFlag | ExpNodeFlag.BuiltinType_Real ) == 0; diff --git a/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs b/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs index d97eaf19..20181f43 100644 --- a/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs @@ -39,13 +39,13 @@ using System.Text; namespace StgSharp.Script.Express { - public abstract class ExpNode : IASTNode + public abstract class ExpSyntaxNode : ISyntaxNode { protected internal ExpNodeFlag _nodeFlag; protected internal Token _source; - protected ExpNode( Token source ) + protected ExpSyntaxNode( Token source ) { _source = source; Next = this; @@ -57,18 +57,18 @@ namespace StgSharp.Script.Express get { return ( _nodeFlag | ExpNodeFlag.BuiltinType_Number ) != 0; } } - public abstract ExpNode Left { get; } + public abstract ExpSyntaxNode Left { get; } - public static ExpNode Empty + public static ExpSyntaxNode Empty { get => ExpEmptyNode._only; } - public ExpNode Next { get; set; } + public ExpSyntaxNode Next { get; set; } - public abstract ExpNode Right { get; } + public abstract ExpSyntaxNode Right { get; } - public ExpNode Previous { get; set; } + public ExpSyntaxNode Previous { get; set; } public abstract IExpElementSource EqualityTypeConvert { get; } @@ -85,7 +85,7 @@ namespace StgSharp.Script.Express get => _source; } - public void AppendNode( ExpNode nextNode ) + public void AppendNode( ExpSyntaxNode nextNode ) { Next.Previous = nextNode; nextNode.Next = Next; @@ -93,24 +93,24 @@ namespace StgSharp.Script.Express Next.Previous = this; } - public static bool IsNullOrEmpty( [AllowNull]ExpNode node ) + public static bool IsNullOrEmpty( [AllowNull]ExpSyntaxNode node ) { return node == ExpEmptyNode._only || node == null; } [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static ExpNode NonOperation( Token source ) + public static ExpSyntaxNode NonOperation( Token source ) { return new ExpEmptyNode( source.Line, source.Column ); } [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static ExpNode NonOperation( int line, int column ) + public static ExpSyntaxNode NonOperation( int line, int column ) { return new ExpEmptyNode( line, column ); } - public void PrependNode( ExpNode previousNode ) + public void PrependNode( ExpSyntaxNode previousNode ) { Previous.Next = previousNode; previousNode.Previous = Previous; @@ -118,7 +118,7 @@ namespace StgSharp.Script.Express previousNode.Next = this; } - public static bool VerifyTypeConvertable( ExpNode left, ExpNode right ) + public static bool VerifyTypeConvertable( ExpSyntaxNode left, ExpSyntaxNode right ) { IExpElementSource tLeft = left.EqualityTypeConvert, tRight = right.EqualityTypeConvert; @@ -132,7 +132,7 @@ namespace StgSharp.Script.Express return tLeft.IsConvertable( tRight ); } - private class ExpEmptyNode : ExpNode + private class ExpEmptyNode : ExpSyntaxNode { internal static readonly ExpEmptyNode _only = new(); @@ -144,9 +144,9 @@ namespace StgSharp.Script.Express public override ExpInstantiableElement EqualityTypeConvert => ExpInstantiableElement.Void; - public override ExpNode Left => _only; + public override ExpSyntaxNode Left => _only; - public override ExpNode Right => _only; + public override ExpSyntaxNode Right => _only; } diff --git a/StgSharp.Script/Express/ExpElementInstance.cs b/StgSharp.Script/Express/ExpElementInstance.cs index 4f546362..4a3f4c33 100644 --- a/StgSharp.Script/Express/ExpElementInstance.cs +++ b/StgSharp.Script/Express/ExpElementInstance.cs @@ -53,7 +53,7 @@ namespace StgSharp.Script.Express } - public abstract class ExpElementInstance : ExpNode + public abstract class ExpElementInstance : ExpSyntaxNode { protected ExpElementInstance( Token source ) @@ -66,9 +66,9 @@ namespace StgSharp.Script.Express public ExpElementType ElementType { get; } - public override ExpNode Left => Empty; + public override ExpSyntaxNode Left => Empty; - public override ExpNode Right => Empty; + public override ExpSyntaxNode Right => Empty; public abstract string TypeName { get; } @@ -124,7 +124,7 @@ namespace StgSharp.Script.Express return false; } - public bool TryGetMember( string name, out ExpNode node ) + public bool TryGetMember( string name, out ExpSyntaxNode node ) { return EqualityTypeConvert.TryGetMember( name, out node ); } diff --git a/StgSharp.Script/Express/ExpElmentSource.cs b/StgSharp.Script/Express/ExpElmentSource.cs index 7e6edbcc..f06c890a 100644 --- a/StgSharp.Script/Express/ExpElmentSource.cs +++ b/StgSharp.Script/Express/ExpElmentSource.cs @@ -45,11 +45,11 @@ namespace StgSharp.Script.Express string Name { get; } - public void AddMember( string name, ExpNode memberNode ); + public void AddMember( string name, ExpSyntaxNode memberNode ); public void Analyse(); - public bool TryGetMember( string name, out ExpNode memberNode ); + public bool TryGetMember( string name, out ExpSyntaxNode memberNode ); } @@ -70,14 +70,14 @@ namespace StgSharp.Script.Express public abstract string Name { get; } - public void AddMember( string name, ExpNode memberNode ) + public void AddMember( string name, ExpSyntaxNode memberNode ) { throw new NotImplementedException(); } public abstract void Analyse(); - public abstract ExpNode CreateInstanceNode( Token t ); + public abstract ExpSyntaxNode CreateInstanceNode( Token t ); public bool IsConvertable( IExpElementSource targetType ) { @@ -92,7 +92,7 @@ namespace StgSharp.Script.Express return element == null || element == ExpVoidElement.Only; } - public abstract bool TryGetMember( string name, out ExpNode memberNode ); + public abstract bool TryGetMember( string name, out ExpSyntaxNode memberNode ); private sealed class ExpVoidElement : ExpInstantiableElement { @@ -112,14 +112,14 @@ namespace StgSharp.Script.Express return; } - public override ExpNode CreateInstanceNode( Token t ) + public override ExpSyntaxNode CreateInstanceNode( Token t ) { - return ExpNode.Empty; + return ExpSyntaxNode.Empty; } - public override bool TryGetMember( string name, out ExpNode memberNode ) + public override bool TryGetMember( string name, out ExpSyntaxNode memberNode ) { - memberNode = ExpNode.Empty; + memberNode = ExpSyntaxNode.Empty; return false; } @@ -136,7 +136,7 @@ namespace StgSharp.Script.Express public abstract string Name { get; } - public void AddMember( string name, ExpNode memberNode ) + public void AddMember( string name, ExpSyntaxNode memberNode ) { throw new NotImplementedException(); } @@ -148,9 +148,9 @@ namespace StgSharp.Script.Express return false; } - public abstract ExpNode MakeReference( params object[] options ); + public abstract ExpSyntaxNode MakeReference( params object[] options ); - public abstract bool TryGetMember( string name, out ExpNode memberNode ); + public abstract bool TryGetMember( string name, out ExpSyntaxNode memberNode ); } } diff --git a/StgSharp.Script/Express/ExpExceptions.cs b/StgSharp.Script/Express/ExpExceptions.cs index 477edfab..cb82f4e4 100644 --- a/StgSharp.Script/Express/ExpExceptions.cs +++ b/StgSharp.Script/Express/ExpExceptions.cs @@ -112,7 +112,7 @@ namespace StgSharp.Script.Express public class ExpCaseNotFoundException : ArgumentOutOfRangeException { - public ExpCaseNotFoundException( ExpSwitchNode token, ExpNode label ) + public ExpCaseNotFoundException( ExpSwitchNode token, ExpSyntaxNode label ) : base( $"Attempt to read or write the label at ({token.Line},{token.Column}), that does not exist in SWITCH expression at ({token.Line},{token.Column})" ) { } diff --git a/StgSharp.Script/Express/ExpNodeNextEnumerator.cs b/StgSharp.Script/Express/ExpNodeNextEnumerator.cs index 9bb4bdb9..7128c419 100644 --- a/StgSharp.Script/Express/ExpNodeNextEnumerator.cs +++ b/StgSharp.Script/Express/ExpNodeNextEnumerator.cs @@ -33,6 +33,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Text; @@ -43,26 +44,40 @@ namespace StgSharp.Script.Express public static class ExpNodeNextEnumeratorExtensions { + public static ExpNodeNextEnumerator AsCollectionEnumerator( this ExpSyntaxNode token ) + { + ExpNodeNextEnumerator enumerator = new ExpNodeNextEnumerator( token ); + enumerator.AssertEnumeratorCount( count ); + IExpElementSource type = token.EqualityTypeConvert; + while( enumerator.MoveNext() ) + { + if( enumerator. Current != type ) { + throw new InvalidCastException(); + } + } + return enumerator; + } + [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static ExpNodeNextEnumerator AsEnumerator( this ExpNode token ) + public static ExpNodeNextEnumerator ToEnumerator( this ExpSyntaxNode token ) { return new ExpNodeNextEnumerator( token ); } } - public class ExpNodeNextEnumerator : IEnumerator + public class ExpNodeNextEnumerator : IEnumerator { - private ExpNode _current; + private ExpSyntaxNode _current; - private List _begin = new List(); + private List _begin = new List(); - public ExpNodeNextEnumerator( ExpNode token ) + public ExpNodeNextEnumerator( ExpSyntaxNode token ) { _begin[ 0 ] = token; _current = token; - ExpNode t = token; + ExpSyntaxNode t = token; while( !ReferenceEquals( t.Next, token ) && t.Next != null ) { t = t.Next; @@ -70,7 +85,7 @@ namespace StgSharp.Script.Express } } - public ExpNode this[ int index ] + public ExpSyntaxNode this[ int index ] { get { @@ -80,7 +95,9 @@ namespace StgSharp.Script.Express } } - public List Values => _begin; + public ExpSyntaxNode Current => _current; + + public List Values => _begin; public void AssertEnumeratorCount( int count ) { @@ -90,14 +107,9 @@ namespace StgSharp.Script.Express } } - void IDisposable.Dispose() + public bool MoveNext() { - return; - } - - bool IEnumerator.MoveNext() - { - ExpNode next = _current.Next; + ExpSyntaxNode next = _current.Next; if( ReferenceEquals( next, _begin ) || next == null ) { return false; } @@ -105,6 +117,11 @@ namespace StgSharp.Script.Express return true; } + void IDisposable.Dispose() + { + return; + } + void IEnumerator.Reset() { _current = _begin[ 0 ]; @@ -112,7 +129,5 @@ namespace StgSharp.Script.Express object IEnumerator.Current => _current; - ExpNode IEnumerator.Current => _current; - } } diff --git a/StgSharp.Script/Express/ExpSourceReader.cs b/StgSharp.Script/Express/ExpSourceReader.cs index 7b0d158b..7a3be91b 100644 --- a/StgSharp.Script/Express/ExpSourceReader.cs +++ b/StgSharp.Script/Express/ExpSourceReader.cs @@ -50,7 +50,9 @@ namespace StgSharp.Script.Express private int _current, _lineNum; private IScriptSourceProvider _provider; - private Regex _nextWordTokenPattern = GetNextWordTokenPattern(), + private Regex + _nextHashtagSymbolPattern = GetHashtagSymbolPattern() , + _nextWordTokenPattern = GetNextWordTokenPattern(), _nextStringLiteralPattern = GetStringLiteralPattern(), _nextNumberLiteralPattern = GetNumberLiteralPattern(), _nextStringLiteralPatternWithSingle = GetStringLiteralPatternWithSingle(), @@ -59,7 +61,7 @@ namespace StgSharp.Script.Express private string _lineCache; private Token _last; - public ExpSourceReader(IScriptSourceProvider provider) + public ExpSourceReader( IScriptSourceProvider provider ) { _provider = provider; _current = 0; @@ -69,7 +71,7 @@ namespace StgSharp.Script.Express public bool IsEmpty { - get => ((string.IsNullOrEmpty(_lineCache) || _current >= _lineCache.Length)) && _provider.IsEmpty; + get => ( ( string.IsNullOrEmpty( _lineCache ) || _current >= _lineCache.Length ) ) && _provider.IsEmpty; } public int LineNumber @@ -79,175 +81,201 @@ namespace StgSharp.Script.Express public unsafe ReadOnlySpan ReadLine() { - bool lineOver = string.IsNullOrEmpty(_lineCache) || _current >= _lineCache.Length; - while (lineOver || _isReadingMultiLineComment) + bool lineOver = string.IsNullOrEmpty( _lineCache ) || _current >= _lineCache.Length; + while( lineOver || _isReadingMultiLineComment ) { - if (IsEmpty) - { + if( IsEmpty ) { return ReadOnlySpan.Empty; } - if (lineOver) + if( lineOver ) { do { - _lineCache = _provider.ReadLine(out _lineNum); - } while (string.IsNullOrEmpty(_lineCache)); + _lineCache = _provider.ReadLine( out _lineNum ); + } while (string.IsNullOrEmpty( _lineCache )); _current = 0; } - if (_isReadingMultiLineComment) + if( _isReadingMultiLineComment ) { int index; - fixed (char* cPtr = _lineCache.AsSpan(_current)) - { + fixed( char* cPtr = _lineCache.AsSpan( _current ) ) { index = UnsafeCompute.IndexOfCharPair( - cPtr, MultiLineEnd, _lineCache.Length); + cPtr, MultiLineEnd, _lineCache.Length ); } - if (index == -1) + if( index == -1 ) { _lineCache = string.Empty; - } - else + } else { _isReadingMultiLineComment = false; _current += index + 2; } } - lineOver = string.IsNullOrEmpty(_lineCache) || _current >= _lineCache.Length; + lineOver = string.IsNullOrEmpty( _lineCache ) || _current >= _lineCache.Length; } - return _lineCache.AsSpan().Slice(_current); + return _lineCache.AsSpan().Slice( _current ); } public unsafe Token ReadToken() { int begin, end, rest; - readLine: + readLine: ReadOnlySpan source; - if (!TryReadLine(out source)) - { + if( !TryReadLine( out source ) ) { return Token.Empty; } - char c = source[0]; + char c = source[ 0 ]; - if (char.IsLetter(c)) + if( char.IsLetter( c ) ) { - Match match = _nextWordTokenPattern.Match(_lineCache, _current); - if (match.Success) + Match match = _nextWordTokenPattern.Match( _lineCache, _current ); + if( match.Success ) { - begin = match.Groups[TokenMark].Index; - end = match.Groups[EndMark].Index; - rest = match.Groups[RestMark].Index; + begin = match.Groups[ TokenMark ].Index; + end = match.Groups[ EndMark ].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; _last = new( - ExpressCompile.PoolString(source[..(end - begin)]), _lineNum, begin, - TokenFlag.Member); + ExpressCompile.PoolString( source[ ..( end - begin ) ] ), _lineNum, begin, + TokenFlag.Member ); return _last; - } - else + } else { - throw new ExpInvalidCharException(_current); + throw new ExpInvalidCharException( _current ); } - } - else if (char.IsPunctuation(c) || char.IsSymbol(c)) + } else if( char.IsPunctuation( c ) || char.IsSymbol( c ) ) { - switch (c) + Match match; + switch( c ) { + case '#': + match = _nextHashtagSymbolPattern.Match( _lineCache, _current ); + if( match.Success ) + { + begin = match.Groups[ "token" ].Index; + end = match.Groups[ "end" ].Index; + rest = match.Groups[ "rest" ].Index; + _current = rest; + _last = new( + ExpressCompile.PoolString( source[ 1..( end - begin ) ] ), _lineNum, + begin, TokenFlag.Member ); + return _last; + } else + { + throw new ExpInvalidCharException( '#' ); + } case '\'': - - case '"': - char cNext = source[1]; - if (cNext == '\"') //empty string + char cNext = source[ 1 ]; + if( cNext == '\'' ) //empty string { begin = _current; _current += 2; - return new(string.Empty, _lineNum, begin, TokenFlag.String); + return new( string.Empty, _lineNum, begin, TokenFlag.String ); } - Match match = _nextStringLiteralPattern.Match(_lineCache, _current); - if (match.Success) + match = _nextStringLiteralPatternWithSingle.Match( _lineCache, _current ); + if( match.Success ) { - begin = match.Groups["token"].Index; - end = match.Groups["end"].Index; - rest = match.Groups["rest"].Index; + begin = match.Groups[ "token" ].Index; + end = match.Groups[ "end" ].Index; + rest = match.Groups[ "rest" ].Index; _current = rest; _last = new( - ExpressCompile.PoolString(source[1..(end - begin)]), _lineNum, - begin, TokenFlag.String); + ExpressCompile.PoolString( source[ 1..( end - begin ) ] ), _lineNum, + begin, TokenFlag.String ); return _last; - } - else + } else { - throw new ExpInvalidCharException('\"'); + throw new ExpInvalidCharException( '\"' ); + } + case '"': + cNext = source[ 1 ]; + if( cNext == '\"' ) //empty string + { + begin = _current; + _current += 2; + return new( string.Empty, _lineNum, begin, TokenFlag.String ); + } + match = _nextStringLiteralPattern.Match( _lineCache, _current ); + if( match.Success ) + { + begin = match.Groups[ "token" ].Index; + end = match.Groups[ "end" ].Index; + rest = match.Groups[ "rest" ].Index; + _current = rest; + _last = new( + ExpressCompile.PoolString( source[ 1..( end - begin ) ] ), _lineNum, + begin, TokenFlag.String ); + return _last; + } else + { + throw new ExpInvalidCharException( '\"' ); } case '(': - cNext = source[1]; - if (cNext == '*') + cNext = source[ 1 ]; + if( cNext == '*' ) { _isReadingMultiLineComment = true; _current += 2; goto readLine; - } - else + } else { begin = _current; _current++; _last = new( - ExpressCompile.PoolString(source[..1]), _lineNum, begin, - TokenFlag.Separator_Left); + ExpressCompile.PoolString( source[ ..1 ] ), _lineNum, begin, + TokenFlag.Separator_Left ); return _last; } case ')' or '}': begin = _current; _current++; _last = new Token( - ExpressCompile.PoolString(source[..1]), _lineNum, begin, - TokenFlag.Separator_Right); + ExpressCompile.PoolString( source[ ..1 ] ), _lineNum, begin, + TokenFlag.Separator_Right ); return _last; case '-': // 1. - number // 2. -- comment // 3. - number type param(UNARY) - // 4. param - param(BINARY) - cNext = source[1]; - if (char.IsNumber(cNext)) + // 4. param - param(BINARY) + cNext = source[ 1 ]; + if( char.IsNumber( cNext ) ) { - match = _nextNumberLiteralPattern.Match(_lineCache, _current); - if (match.Success) + match = _nextNumberLiteralPattern.Match( _lineCache, _current ); + if( match.Success ) { - begin = match.Groups[TokenMark].Index; - end = match.Groups[EndMark].Index; - rest = match.Groups[RestMark].Index; + begin = match.Groups[ TokenMark ].Index; + end = match.Groups[ EndMark ].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; return new( - ExpressCompile.PoolString(source[..(end - begin)]), - _lineNum, begin, TokenFlag.Number); - } - else + ExpressCompile.PoolString( source[ ..( end - begin ) ] ), + _lineNum, begin, TokenFlag.Number ); + } else { - throw new ExpInvalidCharException(_current); + throw new ExpInvalidCharException( _current ); } - } - else if (cNext == '-') + } else if( cNext == '-' ) { _lineCache = string.Empty; _current = 0; goto readLine; - } - else + } else { begin = _current; _current++; - if (_last.Flag == TokenFlag.Member || _last.Flag == - TokenFlag.Index_Right || _last.Flag == TokenFlag.Separator_Right) + if( _last.Flag == TokenFlag.Member || _last.Flag == + TokenFlag.Index_Right || _last.Flag == TokenFlag.Separator_Right ) { _last = new( - ExpressCompile.PoolString(source[..1]), _lineNum, begin, - TokenFlag.Symbol_Binary); - } - else + ExpressCompile.PoolString( source[ ..1 ] ), _lineNum, begin, + TokenFlag.Symbol_Binary ); + } else { _last = new( - ExpressCompile.PoolString(source[..1]), _lineNum, begin, - TokenFlag.Symbol_Unary); + ExpressCompile.PoolString( source[ ..1 ] ), _lineNum, begin, + TokenFlag.Symbol_Unary ); } return _last; } @@ -255,145 +283,144 @@ namespace StgSharp.Script.Express begin = _current; _current++; _last = new Token( - ExpressCompile.PoolString("{"), _lineNum, begin, - TokenFlag.Separator_Left); + ExpressCompile.PoolString( "{" ), _lineNum, begin, + TokenFlag.Separator_Left ); return _last; case '[': begin = _current; _current++; _last = new Token( - ExpressCompile.PoolString("["), _lineNum, begin, - TokenFlag.Index_Left); + ExpressCompile.PoolString( "[" ), _lineNum, begin, + TokenFlag.Index_Left ); return _last; case ']': begin = _current; _current++; _last = new Token( - ExpressCompile.PoolString("]"), _lineNum, begin, - TokenFlag.Index_Right); + ExpressCompile.PoolString( "]" ), _lineNum, begin, + TokenFlag.Index_Right ); return _last; case ';' or ',': begin = _current; _current++; _last = new Token( - ExpressCompile.PoolString(source[..1]), _lineNum, begin, - TokenFlag.Separator_Middle); + ExpressCompile.PoolString( source[ ..1 ] ), _lineNum, begin, + TokenFlag.Separator_Middle ); return _last; case ':': - match = _nextSymbolPattern.Match(_lineCache, _current); - begin = match.Groups[TokenMark].Index; - end = match.Groups[EndMark].Index; - rest = match.Groups[RestMark].Index; + match = _nextSymbolPattern.Match( _lineCache, _current ); + begin = match.Groups[ TokenMark ].Index; + end = match.Groups[ EndMark ].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; - if (end - begin == 1) + if( end - begin == 1 ) { _last = new Token( ExpressCompile.Keyword.Colon, _lineNum, begin, - TokenFlag.Separator_Middle); - } - else + TokenFlag.Separator_Middle ); + } else { _last = new Token( - ExpressCompile.PoolString(source[..(end - begin)]), _lineNum, - begin, TokenFlag.Symbol_Binary); + ExpressCompile.PoolString( source[ ..( end - begin ) ] ), _lineNum, + begin, TokenFlag.Symbol_Binary ); } return _last; case '+' or '/' or '\\' or '*' or '.': - match = _nextSymbolPattern.Match(_lineCache, _current); - begin = match.Groups[TokenMark].Index; - end = match.Groups[EndMark].Index; - rest = match.Groups[RestMark].Index; + match = _nextSymbolPattern.Match( _lineCache, _current ); + begin = match.Groups[ TokenMark ].Index; + end = match.Groups[ EndMark ].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; _last = new Token( - ExpressCompile.PoolString(source[..(end - begin)]), _lineNum, - begin, TokenFlag.Symbol_Binary); + ExpressCompile.PoolString( source[ ..( end - begin ) ] ), _lineNum, + begin, TokenFlag.Symbol_Binary ); return _last; case '=': begin = _current; _current++; _last = new Token( ExpressCompile.Keyword.Equal, _lineNum, begin, - TokenFlag.Symbol_Binary); + TokenFlag.Symbol_Binary ); return _last; default: - throw new ExpInvalidCharException(c); + throw new ExpInvalidCharException( c ); } - } - else if (char.IsNumber(c)) + } else if( char.IsNumber( c ) ) { - Match match = _nextNumberLiteralPattern.Match(_lineCache, _current); - if (match.Success) + Match match = _nextNumberLiteralPattern.Match( _lineCache, _current ); + if( match.Success ) { - begin = match.Groups[TokenMark].Index; - end = match.Groups[EndMark].Index; - rest = match.Groups[RestMark].Index; + begin = match.Groups[ TokenMark ].Index; + end = match.Groups[ EndMark ].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; - string str = ExpressCompile.PoolString(source[..(end - begin)]); - return new(str, _lineNum, begin, TokenFlag.Number); - } - else + string str = ExpressCompile.PoolString( source[ ..( end - begin ) ] ); + return new( str, _lineNum, begin, TokenFlag.Number ); + } else { - throw new ExpInvalidCharException(_current); + throw new ExpInvalidCharException( _current ); } - } - else if (char.IsWhiteSpace(c)) + } else if( char.IsWhiteSpace( c ) ) { - Match match = _skipBlankPattern.Match(_lineCache, _current); - if (match.Success) + Match match = _skipBlankPattern.Match( _lineCache, _current ); + if( match.Success ) { - rest = match.Groups[RestMark].Index; + rest = match.Groups[ RestMark ].Index; _current = rest; goto readLine; - } - else + } else { - throw new ExpInvalidCharException(_current); + throw new ExpInvalidCharException( _current ); } - } - else + } else { - throw new ExpInvalidCharException(c); + throw new ExpInvalidCharException( c ); } } - public bool TryReadLine(out ReadOnlySpan line) + public bool TryReadLine( out ReadOnlySpan line ) { line = ReadLine(); return line != ReadOnlySpan.Empty; } - public bool TryReadToken(out Token t) + public bool TryReadToken( out Token t ) { t = ReadToken(); return !IsEmpty; } + [GeneratedRegex( + @"(?#[0-9A-Za-z]+)(?\s*?)(?\S|$)", + RegexOptions.Singleline )] + private static partial Regex GetHashtagSymbolPattern(); + [GeneratedRegex( @"(?[a-zA-Z][a-zA-Z0-9_]*)(?\s*?)(?\S|$)", - RegexOptions.Singleline)] + RegexOptions.Singleline )] private static partial Regex GetNextWordTokenPattern(); [GeneratedRegex( @"(?-?\s*?[0-9]+(?:\.[0-9]*)?E?(?:[+-]?[0-9]+)?)(?\s*?)(?\S|$)", - RegexOptions.Singleline)] + RegexOptions.Singleline )] private static partial Regex GetNumberLiteralPattern(); - [GeneratedRegex(@"(?:\s+?)(?\S|$)", RegexOptions.Singleline)] + [GeneratedRegex( @"(?:\s+?)(?\S|$)", RegexOptions.Singleline )] private static partial Regex GetSkipBlankPattern(); [GeneratedRegex( @"(?"")(?>\\\\|\\""|(?!')[^""])*(?""|$)\s*?(?\S|$)", - RegexOptions.Singleline)] + RegexOptions.Singleline )] private static partial Regex GetStringLiteralPattern(); [GeneratedRegex( @"(?')(?>\\\\|\\'|''|(?!')[^'])*(?')\s*?(?\S|$)", - RegexOptions.Singleline)] + RegexOptions.Singleline )] private static partial Regex GetStringLiteralPatternWithSingle(); [GeneratedRegex( @"(?[:<>=+\-*\/]+)(?\s?)\s*?(?\S|$)", - RegexOptions.Singleline)] + RegexOptions.Singleline )] private static partial Regex GetSymbolPattern(); } diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.CaseOf.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.CaseOf.cs index af15c72a..ad37f904 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.CaseOf.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.CaseOf.cs @@ -45,7 +45,7 @@ namespace StgSharp.Script.Express private bool AppendToken_CaseOf( Token t ) { Token op; - ExpNode root; + ExpSyntaxNode root; switch( t.Value ) { case ExpKeyword.Case: @@ -108,19 +108,20 @@ namespace StgSharp.Script.Express Begin = t; } - public Dictionary Cases { get; } = new Dictionary(); + public Dictionary Cases { get; } = new Dictionary( + ); - public ExpNode CaseExpression { get; set; } + public ExpSyntaxNode CaseExpression { get; set; } - public ExpNode DefaultCase { get; set; } + public ExpSyntaxNode DefaultCase { get; set; } - public ExpNode CurrentCase { get; set; } + public ExpSyntaxNode CurrentCase { get; set; } public string CurrentState { get; set; } public Token Begin { get; init; } - public void CloseCurrentCase( ExpNode root ) + public void CloseCurrentCase( ExpSyntaxNode root ) { Cases.Add( CurrentCase, root ); } diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.Common.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.Common.cs index 76a6e256..98e6042d 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.Common.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.Common.cs @@ -62,7 +62,7 @@ namespace StgSharp.Script.Express if( t.Flag != TokenFlag.Index_Left ) { return false; } - if( _cache.TryPeekOperand( out bool isNode, out _, out ExpNode? node ) ) + if( _cache.TryPeekOperand( out bool isNode, out _, out ExpSyntaxNode? node ) ) { if( node.EqualityTypeConvert is not ExpCollectionBase ) { ExpInvalidSyntaxException.ThrowNonCollectionIndex( t ); @@ -83,8 +83,8 @@ namespace StgSharp.Script.Express ClosePrefixReverse( t ); //make index node - _cache.PopOperand( out _, out ExpNode? expNode ); - if( !_cache.PopOperand( out Token colleToken, out ExpNode? colleNode ) ) { } + _cache.PopOperand( out _, out ExpSyntaxNode? expNode ); + if( !_cache.PopOperand( out Token colleToken, out ExpSyntaxNode? colleNode ) ) { } _cache.PushOperand( ExpCollectionIndexNode.Create( t, ( colleNode as ExpCollectionInstanceBase )!, expNode ) ); @@ -126,7 +126,7 @@ namespace StgSharp.Script.Express while( _cache.OperatorAheadOfDepth > 0 ) { _cache.TryPopOperator( out Token op ); - ExpNode node = ConvertAndPushOneOperator( op ); + ExpSyntaxNode node = ConvertAndPushOneOperator( op ); } switch( _cache.OperandAheadOfDepth ) { @@ -134,10 +134,10 @@ namespace StgSharp.Script.Express if( t.Value == ";" ) { return true; } - _cache.StatementsInDepth.Push( ExpNode.Empty ); + _cache.StatementsInDepth.Push( ExpSyntaxNode.Empty ); goto case 1; case 1: - _cache.PopOperand( out _, out ExpNode? statement ); + _cache.PopOperand( out _, out ExpSyntaxNode? statement ); _cache.StatementsInDepth.Push( statement ); return true; default: @@ -189,7 +189,7 @@ namespace StgSharp.Script.Express if( cmp >= 0 ) { _cache.PopOperator(); - ExpNode node = ConvertAndPushOneOperator( tmp ); + ExpSyntaxNode node = ConvertAndPushOneOperator( tmp ); goto processPrecedence; } } @@ -249,7 +249,7 @@ namespace StgSharp.Script.Express private bool TryParseInstance( Token t ) { if( _local.TryGetMember( t.Value, - out ExpNode? node ) && node is ExpElementInstance instance ) + out ExpSyntaxNode? node ) && node is ExpElementInstance instance ) { _cache.PushOperand( ExpInstanceReferenceNode.MakeReferenceFrom( t, instance ) ); return true; @@ -260,7 +260,7 @@ namespace StgSharp.Script.Express } else if( _cache.IsLastAddedOperator ) { if( _cache.PeekOperand( out _, - out ExpNode? typenode ) && typenode is ExpMetaRefNode typeRef ) + out ExpSyntaxNode? typenode ) && typenode is ExpMetaRefNode typeRef ) { _cache.PopOperand( out _, out _ ); _local.AddMember( t.Value, typeRef.SourceRef.CreateInstanceNode( t ) ); diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.If.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.If.cs index 03bcd137..1b95928f 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.If.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.If.cs @@ -58,7 +58,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? node ); + _cache.PopOperand( out _, out ExpSyntaxNode? node ); state.CurrentState = t.Value; state.BoolExpression = node; } else @@ -71,7 +71,7 @@ namespace StgSharp.Script.Express state = _cache.StateOfCurrentDepth(); if( state.CurrentState == ExpKeyword.Then ) { - ExpNode node = _cache.PackAllStatements(); + ExpSyntaxNode node = _cache.PackAllStatements(); state.CurrentState = t.Value; state.ExpressionIfTrue = node; } else @@ -85,13 +85,13 @@ namespace StgSharp.Script.Express state = _cache.StateOfCurrentDepth(); if( state.CurrentState == ExpKeyword.Then ) { - ExpNode trueNode = _cache.PackAllStatements(); + ExpSyntaxNode trueNode = _cache.PackAllStatements(); state.CurrentState = t.Value; state.ExpressionIfTrue = trueNode; - state.ExpressionIfFalse = ExpNode.Empty; + state.ExpressionIfFalse = ExpSyntaxNode.Empty; } else if( state.CurrentState == ExpKeyword.Else ) { - ExpNode falseNode = _cache.PackAllStatements(); + ExpSyntaxNode falseNode = _cache.PackAllStatements(); state.CurrentState = t.Value; state.ExpressionIfFalse = falseNode; } else @@ -115,11 +115,11 @@ namespace StgSharp.Script.Express private class IfBranchStateCache : ICompileDepthState { - public ExpNode BoolExpression { get; set; } + public ExpSyntaxNode BoolExpression { get; set; } - public ExpNode ExpressionIfTrue { get; set; } + public ExpSyntaxNode ExpressionIfTrue { get; set; } - public ExpNode ExpressionIfFalse { get; set; } + public ExpSyntaxNode ExpressionIfFalse { get; set; } public string CurrentState { get; set; } diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.OperatorParser.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.OperatorParser.cs index 5442d158..4d5bd903 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.OperatorParser.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.OperatorParser.cs @@ -48,9 +48,9 @@ namespace StgSharp.Script.Express return leftPrecedence - rightPrecedence; } - public bool TryGenerateUnaryNode( Token t, out ExpNode node ) + public bool TryGenerateUnaryNode( Token t, out ExpSyntaxNode node ) { - ExpNode operand = GetNextOperandCache(); + ExpSyntaxNode operand = GetNextOperandCache(); switch( t.Value ) { case ExpKeyword.UnaryPlus: @@ -63,7 +63,7 @@ namespace StgSharp.Script.Express node = ExpUnaryOperatorNode.UnaryNot( t, operand ); return true; default: - node = ExpNode.Empty; + node = ExpSyntaxNode.Empty; return false; } } @@ -72,12 +72,12 @@ namespace StgSharp.Script.Express /// WARNING: This method cannot process INDEXOF, FUNCTION CALLING, LOOP and any ENDING /// SYMBOLS. /// - private ExpNode ConvertAndPushOneOperator( Token op ) + private ExpSyntaxNode ConvertAndPushOneOperator( Token op ) { switch( op.Flag ) { case TokenFlag.Symbol_Unary: - TryGenerateUnaryNode( op, out ExpNode? node ); + TryGenerateUnaryNode( op, out ExpSyntaxNode? node ); _cache.PushOperand( node ); return node; case TokenFlag.Symbol_Binary: @@ -87,7 +87,7 @@ namespace StgSharp.Script.Express case TokenFlag.Member: if( _context.TryGetFunction( op.Value, out ExpFunctionSource? f ) ) { - if( !_cache.PopOperand( out Token t, out ExpNode? p ) ) + if( !_cache.PopOperand( out Token t, out ExpSyntaxNode? p ) ) { node = ExpFunctionCallingNode.CallFunction( op, f, p ); return node; @@ -99,7 +99,7 @@ namespace StgSharp.Script.Express } } else if( _context.TryGetProcedure( op.Value, out ExpProcedureSource? p ) ) { - if( !_cache.PopOperand( out Token t, out ExpNode? param ) ) + if( !_cache.PopOperand( out Token t, out ExpSyntaxNode? param ) ) { node = ExpProcedureCallingNode.CallProcedure( op, p, param ); return node; @@ -111,7 +111,7 @@ namespace StgSharp.Script.Express } } else if( ExpSchema.BuiltinSchema.TryGetFunction( op.Value, out f ) ) { - if( !_cache.PopOperand( out Token t, out ExpNode? param ) ) + if( !_cache.PopOperand( out Token t, out ExpSyntaxNode? param ) ) { node = ExpFunctionCallingNode.CallFunction( op, f, param ); return node; @@ -132,10 +132,10 @@ namespace StgSharp.Script.Express } } - private bool TryGenerateBinaryNode( Token t, out ExpNode node ) + private bool TryGenerateBinaryNode( Token t, out ExpSyntaxNode node ) { - ExpNode right = GetNextOperandCache(); - ExpNode left = GetNextOperandCache(); + ExpSyntaxNode right = GetNextOperandCache(); + ExpSyntaxNode left = GetNextOperandCache(); switch( t.Value ) { case ExpKeyword.Add: @@ -172,7 +172,7 @@ namespace StgSharp.Script.Express node = ExpBinaryOperatorNode.CompareInstanceNotEqual( t, left, right ); return true; default: - node = ExpNode.Empty; + node = ExpSyntaxNode.Empty; return false; } } diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.PrefixReverseAnalysing.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.PrefixReverseAnalysing.cs index 52647ef1..d2fac134 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.PrefixReverseAnalysing.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.PrefixReverseAnalysing.cs @@ -45,12 +45,12 @@ namespace StgSharp.Script.Express private void ClosePrefixReverse( Token rightSeparator ) { Token op; - ExpNode root; + ExpSyntaxNode root; if( _cache.OperatorAheadOfDepth == 0 ) { if( _cache.OperandAheadOfDepth == 1 ) { - _cache.PopOperand( out _, out ExpNode? statement ); + _cache.PopOperand( out _, out ExpSyntaxNode? statement ); _cache.StatementsInDepth.Push( statement ); } else { diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.RepeatLoop.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.RepeatLoop.cs index 92d454b4..7b1df2e2 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.RepeatLoop.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.RepeatLoop.cs @@ -84,7 +84,7 @@ namespace StgSharp.Script.Express AppendToken_common( t ); return false; } - ExpNode root = _cache.PackAllStatements(); + ExpSyntaxNode root = _cache.PackAllStatements(); state.Body = root; _cache.DecreaseDepth(); if( ExpTypeSource.IsNullOrVoid( state.IncrementVariableType ) ) @@ -114,7 +114,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? root ); + _cache.PopOperand( out _, out ExpSyntaxNode? root ); state.Begin = root; return true; default: @@ -143,7 +143,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? root ); + _cache.PopOperand( out _, out ExpSyntaxNode? root ); state.End = root; return true; } @@ -168,7 +168,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? root ); + _cache.PopOperand( out _, out ExpSyntaxNode? root ); state.StepIncrement = root; return true; } @@ -187,7 +187,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? root ); + _cache.PopOperand( out _, out ExpSyntaxNode? root ); state.UntilExpression = root; return true; } @@ -210,7 +210,7 @@ namespace StgSharp.Script.Express if( ExpTypeSource.IsNullOrVoid( state.IncrementVariableType ) ) { if( ( _local.TryGetMember( t.Value, - out ExpNode? node ) && node is ExpElementInstance instance ) || _tempVariableInLoops.TryGetValue( + out ExpSyntaxNode? node ) && node is ExpElementInstance instance ) || _tempVariableInLoops.TryGetValue( t.Value, out instance ) ) { state.IncrementVariable = ExpInstanceReferenceNode.MakeReferenceFrom( @@ -247,7 +247,7 @@ namespace StgSharp.Script.Express while( _cache.TryPopOperator( out Token op ) ) { ConvertAndPushOneOperator( op ); } - _cache.PopOperand( out _, out ExpNode? root ); + _cache.PopOperand( out _, out ExpSyntaxNode? root ); state.WhileExpression = root; return true; } @@ -258,23 +258,23 @@ namespace StgSharp.Script.Express public RepeatLoopState( Token t ) { Position = t; - UntilExpression = ExpNode.Empty; - WhileExpression = ExpNode.Empty; + UntilExpression = ExpSyntaxNode.Empty; + WhileExpression = ExpSyntaxNode.Empty; } public ExpInstanceReferenceNode IncrementVariable { get; set; } - public ExpNode StepIncrement { get; set; } + public ExpSyntaxNode StepIncrement { get; set; } - public ExpNode Begin { get; set; } + public ExpSyntaxNode Begin { get; set; } - public ExpNode End { get; set; } + public ExpSyntaxNode End { get; set; } - public ExpNode UntilExpression { get; set; } + public ExpSyntaxNode UntilExpression { get; set; } - public ExpNode WhileExpression { get; set; } + public ExpSyntaxNode WhileExpression { get; set; } - public ExpNode Body { get; set; } + public ExpSyntaxNode Body { get; set; } public ExpTypeSource IncrementVariableType { get; set; } diff --git a/StgSharp.Script/Express/ExpSyntaxAnalyzer.cs b/StgSharp.Script/Express/ExpSyntaxAnalyzer.cs index b09b52ba..dcb054b5 100644 --- a/StgSharp.Script/Express/ExpSyntaxAnalyzer.cs +++ b/StgSharp.Script/Express/ExpSyntaxAnalyzer.cs @@ -51,19 +51,19 @@ namespace StgSharp.Script.Express private const int TokenGenerated = 0; private const int TokenTypeNotMatch = -1; - private CompileStack _cache; - private ExpNode _lastStatement; + private CompileStack _cache; private ExpSchema _context; + private ExpSyntaxNode _lastStatement; private IExpElementSource _local; public ExpSyntaxAnalyzer() { - _cache = new CompileStack(); + _cache = new CompileStack(); } public ExpSyntaxAnalyzer( ExpSchema context, IExpElementSource local ) { - _cache = new CompileStack(); + _cache = new CompileStack(); ArgumentNullException.ThrowIfNull( context ); if( context is not ExpSchema_Builtin ) { @@ -95,9 +95,9 @@ namespace StgSharp.Script.Express } } - public ExpNode GetNextOperandCache() + public ExpSyntaxNode GetNextOperandCache() { - if( _cache.PopOperand( out Token t, out ExpNode? n ) ) + if( _cache.PopOperand( out Token t, out ExpSyntaxNode? n ) ) { return n; } else diff --git a/StgSharp.Script/Express/IExpMarshalType.cs b/StgSharp.Script/Express/IExpMarshalType.cs index 8acb4506..a2b0fc1e 100644 --- a/StgSharp.Script/Express/IExpMarshalType.cs +++ b/StgSharp.Script/Express/IExpMarshalType.cs @@ -39,7 +39,7 @@ namespace StgSharp.Script.Express public interface IExpMarshalType { - static abstract TSelf Create( string name, ExpNode node ); + static abstract TSelf Create( string name, ExpSyntaxNode node ); } } diff --git a/StgSharp.Script/obj/StgSharp.Script.csproj.nuget.dgspec.json b/StgSharp.Script/obj/StgSharp.Script.csproj.nuget.dgspec.json index 0bc62166..c26411b0 100644 --- a/StgSharp.Script/obj/StgSharp.Script.csproj.nuget.dgspec.json +++ b/StgSharp.Script/obj/StgSharp.Script.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -103,7 +102,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Script/obj/project.assets.json b/StgSharp.Script/obj/project.assets.json index ef1afc08..81a0f901 100644 --- a/StgSharp.Script/obj/project.assets.json +++ b/StgSharp.Script/obj/project.assets.json @@ -1255,7 +1255,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs index 35150b6f..9958fd7a 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9457309c5ab188ce824a10ab60e572553986b6eb")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json index 2440bc0f..4b461246 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/2692495dc8460e1f60a2d073f162c5f526e1ba1b/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90/*"}} \ No newline at end of file diff --git a/StgSharp.TerminalDialogue/obj/StgSharp.TerminalDialogue.csproj.nuget.dgspec.json b/StgSharp.TerminalDialogue/obj/StgSharp.TerminalDialogue.csproj.nuget.dgspec.json index e3fa3f24..ea2512c9 100644 --- a/StgSharp.TerminalDialogue/obj/StgSharp.TerminalDialogue.csproj.nuget.dgspec.json +++ b/StgSharp.TerminalDialogue/obj/StgSharp.TerminalDialogue.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.TerminalDialogue/obj/project.assets.json b/StgSharp.TerminalDialogue/obj/project.assets.json index 3ba0b81e..35a31ca5 100644 --- a/StgSharp.TerminalDialogue/obj/project.assets.json +++ b/StgSharp.TerminalDialogue/obj/project.assets.json @@ -414,7 +414,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharp.TerminalDialogue/obj/x64/Debug/StgSharp.TerminalDialogue.AssemblyInfo.cs b/StgSharp.TerminalDialogue/obj/x64/Debug/StgSharp.TerminalDialogue.AssemblyInfo.cs index e0691a40..38da6c12 100644 --- a/StgSharp.TerminalDialogue/obj/x64/Debug/StgSharp.TerminalDialogue.AssemblyInfo.cs +++ b/StgSharp.TerminalDialogue/obj/x64/Debug/StgSharp.TerminalDialogue.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.TerminalDialogue")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+148b0fed4a1abaaeaa3a28e7c7b088590805ebef")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.TerminalDialogue")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.TerminalDialogue")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json b/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json index 3baac454..8e9c6664 100644 --- a/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json +++ b/StgSharpDebug/obj/StgSharpDebug.csproj.nuget.dgspec.json @@ -27,7 +27,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -103,7 +102,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -176,7 +174,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { @@ -256,7 +253,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharpDebug/obj/project.assets.json b/StgSharpDebug/obj/project.assets.json index 36056413..5c77512f 100644 --- a/StgSharpDebug/obj/project.assets.json +++ b/StgSharpDebug/obj/project.assets.json @@ -1294,7 +1294,6 @@ "sources": { "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, "C:\\Program Files\\dotnet\\library-packs": {}, - "D:\\Programmer\\NugetLocal": {}, "https://api.nuget.org/v3/index.json": {} }, "frameworks": { diff --git a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs index 69538707..9271c89a 100644 --- a/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs +++ b/StgSharpDebug/obj/x64/Debug/net8.0/StgSharpDebug.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+2692495dc8460e1f60a2d073f162c5f526e1ba1b")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c29993fd8497704d2ddeab3e1a3f8bfa5caa8d90")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]