HLSF use long as aloloc size

This commit is contained in:
Nitload
2026-02-23 12:32:15 +08:00
parent 4bd88ccbca
commit c155cab510
552 changed files with 154266 additions and 154330 deletions
+101 -101
View File
@@ -1,101 +1,101 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpConst"
// 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;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Script.Express
{
public sealed class ExpConstantCollectionSource : ExpImmutableElement
{
private Dictionary<string, ExpElementInstance> _constants;
private IScriptSourceProvider _sourceProvider;
public ExpConstantCollectionSource(IScriptSourceProvider sourceProvider)
{
_sourceProvider = sourceProvider;
_constants = new Dictionary<string, ExpElementInstance>(ExpressCompile.Multiplexer);
}
public override ExpElementType ElementType => ExpElementType.Const;
public override IScriptSourceProvider SourceProvider => _sourceProvider;
public override string Name
{
get => ExpressCompile.Keyword.Constant;
}
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
if (options.Length == 0 || options[0] is not string str) {
return null!;
}
if (_constants.Count == 0) {
return null!;
}
if (_constants.TryGetValue(str, out ExpElementInstance? token)) {
return token;
}
return null!;
}
public bool TryGetConstant(string name, out ExpElementInstance instance)
{
return _constants.TryGetValue(name, out instance);
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
if (_constants.TryGetValue(name, out ExpElementInstance? node))
{
memberNode = node;
return true;
}
memberNode = ExpSyntaxNode.Empty;
return false;
}
internal void AddConstant(string name, ExpElementInstance value)
{
_constants.Add(name, value);
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpConst"
// 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;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Script.Express
{
public sealed class ExpConstantCollectionSource : ExpImmutableElement
{
private Dictionary<string, ExpElementInstance> _constants;
private IScriptSourceProvider _sourceProvider;
public ExpConstantCollectionSource(IScriptSourceProvider sourceProvider)
{
_sourceProvider = sourceProvider;
_constants = new Dictionary<string, ExpElementInstance>(ExpressCompile.Multiplexer);
}
public override ExpElementType ElementType => ExpElementType.Const;
public override IScriptSourceProvider SourceProvider => _sourceProvider;
public override string Name
{
get => ExpressCompile.Keyword.Constant;
}
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
if (options.Length == 0 || options[0] is not string str) {
return null!;
}
if (_constants.Count == 0) {
return null!;
}
if (_constants.TryGetValue(str, out ExpElementInstance? token)) {
return token;
}
return null!;
}
public bool TryGetConstant(string name, out ExpElementInstance instance)
{
return _constants.TryGetValue(name, out instance);
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
if (_constants.TryGetValue(name, out ExpElementInstance? node))
{
memberNode = node;
return true;
}
memberNode = ExpSyntaxNode.Empty;
return false;
}
internal void AddConstant(string name, ExpElementInstance value)
{
_constants.Add(name, value);
}
}
}
+69 -69
View File
@@ -1,69 +1,69 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpEntity"
// 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.Script.Express
{
public class ExpEntitySource : ExpInstantiableElement
{
private AbstractSyntaxTree<ExpSyntaxNode, IExpElementSource> _expressionTree;
private ScriptSourceTransmitter _source;
private string _name;
public ExpEntitySource(string name, ScriptSourceTransmitter provider)
{
_name = name;
_source = provider;
}
public override ExpElementType ElementType => ExpElementType.Entity;
public override IScriptSourceProvider SourceProvider => _source;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode CreateInstanceNode(Token t)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
throw new NotImplementedException();
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpEntity"
// 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.Script.Express
{
public class ExpEntitySource : ExpInstantiableElement
{
private AbstractSyntaxTree<ExpSyntaxNode, IExpElementSource> _expressionTree;
private ScriptSourceTransmitter _source;
private string _name;
public ExpEntitySource(string name, ScriptSourceTransmitter provider)
{
_name = name;
_source = provider;
}
public override ExpElementType ElementType => ExpElementType.Entity;
public override IScriptSourceProvider SourceProvider => _source;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode CreateInstanceNode(Token t)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
throw new NotImplementedException();
}
}
}
+94 -94
View File
@@ -1,94 +1,94 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpFunction"
// 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.Script.Express
{
public class ExpFunctionSource : ExpImmutableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
public ExpFunctionSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
}
public Dictionary<string, ExpElementInstance> FuncParams { get; init; } = new Dictionary<string, ExpElementInstance>(
);
public Dictionary<string, ExpElementInstance> LocalVariables { get; init; } = new Dictionary<string, ExpElementInstance>(
);
public override ExpElementType ElementType => ExpElementType.Function;
public ExpInstantiableElement ReturningType { get; protected set; }
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public string CallingFormat { get; private set; }
public override void Analyse()
{
throw new NotImplementedException();
/*
* generate parameter list,
* generate C# code
* generate calling syntax
*/
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
if (FuncParams.TryGetValue(name, out ExpElementInstance? param))
{
memberNode = param;
return true;
}
if (LocalVariables.TryGetValue(name, out ExpElementInstance? variable))
{
memberNode = variable;
return true;
}
memberNode = ExpSyntaxNode.Empty;
return false;
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpFunction"
// 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.Script.Express
{
public class ExpFunctionSource : ExpImmutableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
public ExpFunctionSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
}
public Dictionary<string, ExpElementInstance> FuncParams { get; init; } = new Dictionary<string, ExpElementInstance>(
);
public Dictionary<string, ExpElementInstance> LocalVariables { get; init; } = new Dictionary<string, ExpElementInstance>(
);
public override ExpElementType ElementType => ExpElementType.Function;
public ExpInstantiableElement ReturningType { get; protected set; }
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public string CallingFormat { get; private set; }
public override void Analyse()
{
throw new NotImplementedException();
/*
* generate parameter list,
* generate C# code
* generate calling syntax
*/
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
if (FuncParams.TryGetValue(name, out ExpElementInstance? param))
{
memberNode = param;
return true;
}
if (LocalVariables.TryGetValue(name, out ExpElementInstance? variable))
{
memberNode = variable;
return true;
}
memberNode = ExpSyntaxNode.Empty;
return false;
}
}
}
@@ -1,61 +1,61 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpProcedureSource"
// 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.Text;
using System.Threading.Tasks;
namespace StgSharp.Script.Express
{
public class ExpProcedureSource : ExpImmutableElement
{
public override ExpElementType ElementType => ExpElementType.Procedure;
public override IScriptSourceProvider SourceProvider => throw new NotImplementedException();
public override string Name => throw new NotImplementedException();
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
throw new NotImplementedException();
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpProcedureSource"
// 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.Text;
using System.Threading.Tasks;
namespace StgSharp.Script.Express
{
public class ExpProcedureSource : ExpImmutableElement
{
public override ExpElementType ElementType => ExpElementType.Procedure;
public override IScriptSourceProvider SourceProvider => throw new NotImplementedException();
public override string Name => throw new NotImplementedException();
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
throw new NotImplementedException();
}
}
}
+91 -91
View File
@@ -1,91 +1,91 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpRule"
// 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.Data;
using System.Reflection.Metadata.Ecma335;
using System.Text;
namespace StgSharp.Script.Express
{
public class ExpRule : ExpElementInstance
{
private ExpRuleSource _source;
public ExpRule(Token source) : base(source) { }
public object? value => throw new NotImplementedException();
public override ExpInstantiableElement EqualityTypeConvert => throw new NotImplementedException(
);
public override ExpSyntaxNode Left => throw new NotImplementedException();
public override ExpSyntaxNode Right => throw new NotImplementedException();
public override string TypeName => _source.Name;
}
public class ExpRuleSource : ExpImmutableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
public ExpRuleSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
}
public override ExpElementType ElementType => ExpElementType.Rule;
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
memberNode = ExpSyntaxNode.Empty;
return false;
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpRule"
// 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.Data;
using System.Reflection.Metadata.Ecma335;
using System.Text;
namespace StgSharp.Script.Express
{
public class ExpRule : ExpElementInstance
{
private ExpRuleSource _source;
public ExpRule(Token source) : base(source) { }
public object? value => throw new NotImplementedException();
public override ExpInstantiableElement EqualityTypeConvert => throw new NotImplementedException(
);
public override ExpSyntaxNode Left => throw new NotImplementedException();
public override ExpSyntaxNode Right => throw new NotImplementedException();
public override string TypeName => _source.Name;
}
public class ExpRuleSource : ExpImmutableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
public ExpRuleSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
}
public override ExpElementType ElementType => ExpElementType.Rule;
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpSyntaxNode MakeReference(params object[] options)
{
throw new NotImplementedException();
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
memberNode = ExpSyntaxNode.Empty;
return false;
}
}
}
+112 -112
View File
@@ -1,113 +1,113 @@
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpType"
// 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.Script;
using System;
using System.Collections.Generic;
namespace StgSharp.Script.Express
{
public class ExpTypeSource : ExpInstantiableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
protected bool _isBuiltinType;
protected ExpTypeSource(string name)
{
_name = name;
_transmitter = ScriptSourceTransmitter.Empty;
_isBuiltinType = true;
}
public ExpTypeSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
_isBuiltinType = false;
}
public bool IsLanguageBuiltinType
{
get => _isBuiltinType;
}
public override ExpElementType ElementType => ExpElementType.Type;
public static ExpTypeSource Void
{
get => ExpVoidType.Only;
}
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpElementInstance CreateInstanceNode(Token t)
{
throw new NotImplementedException();
}
public static bool IsNullOrVoid(IExpElementSource type)
{
return type == null || type == ExpVoidType.Only;
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
memberNode = ExpSyntaxNode.Empty;
return false;
}
private class ExpVoidType : ExpTypeSource
{
private static readonly ExpVoidType _onlyInstance = new ExpVoidType();
private ExpVoidType() : base(string.Empty) { }
public static ExpVoidType Only
{
get => _onlyInstance;
}
public override void Analyse()
{
return;
}
}
}
//-----------------------------------------------------------------------
// -----------------------------------------------------------------------
// file="ExpType"
// 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.Script;
using System;
using System.Collections.Generic;
namespace StgSharp.Script.Express
{
public class ExpTypeSource : ExpInstantiableElement
{
private ScriptSourceTransmitter _transmitter;
private string _name;
protected bool _isBuiltinType;
protected ExpTypeSource(string name)
{
_name = name;
_transmitter = ScriptSourceTransmitter.Empty;
_isBuiltinType = true;
}
public ExpTypeSource(string name, ScriptSourceTransmitter transmitter)
{
_name = name;
_transmitter = transmitter;
_isBuiltinType = false;
}
public bool IsLanguageBuiltinType
{
get => _isBuiltinType;
}
public override ExpElementType ElementType => ExpElementType.Type;
public static ExpTypeSource Void
{
get => ExpVoidType.Only;
}
public override IScriptSourceProvider SourceProvider => _transmitter;
public override string Name => _name;
public override void Analyse()
{
throw new NotImplementedException();
}
public override ExpElementInstance CreateInstanceNode(Token t)
{
throw new NotImplementedException();
}
public static bool IsNullOrVoid(IExpElementSource type)
{
return type == null || type == ExpVoidType.Only;
}
public override bool TryGetMember(string name, out ExpSyntaxNode memberNode)
{
memberNode = ExpSyntaxNode.Empty;
return false;
}
private class ExpVoidType : ExpTypeSource
{
private static readonly ExpVoidType _onlyInstance = new ExpVoidType();
private ExpVoidType() : base(string.Empty) { }
public static ExpVoidType Only
{
get => _onlyInstance;
}
public override void Analyse()
{
return;
}
}
}
}