EP 0.1.1
This commit is contained in:
@@ -53,7 +53,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="namespace"/> name</b>
|
/// <b><see langword="namespace"/> name { ... }</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class Namespace : Internal.Keyword<Namespace>
|
public sealed class Namespace : Internal.Keyword<Namespace>
|
||||||
{
|
{
|
||||||
@@ -63,7 +63,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="def"/> FunctionName(type1 arg1, type args...) -> return-type</b>
|
/// <b><see langword="def"/> FunctionName(parameter-list) -> return-type { ... return return-type-instance; }</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class FunctionDef : Internal.Keyword<FunctionDef>
|
public sealed class FunctionDef : Internal.Keyword<FunctionDef>
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="return"/> symbol</b>
|
/// <b><see langword="return"/> symbol;</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class Return : Internal.Keyword<Return>
|
public sealed class Return : Internal.Keyword<Return>
|
||||||
{
|
{
|
||||||
@@ -83,7 +83,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="if"/>(bool-expression)</b>
|
/// <b><see langword="if"/>(bool-expression) expression</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class If : Internal.Keyword<If>
|
public sealed class If : Internal.Keyword<If>
|
||||||
{
|
{
|
||||||
@@ -103,7 +103,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="while"/>(bool-expression)</b>
|
/// <b><see langword="while"/>(bool-expression) expression</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class While : Internal.Keyword<While>
|
public sealed class While : Internal.Keyword<While>
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="break"/></b>
|
/// <b><see langword="break"/>;</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class Break : Internal.Keyword<Break>
|
public sealed class Break : Internal.Keyword<Break>
|
||||||
{
|
{
|
||||||
@@ -123,7 +123,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="continue"/></b>
|
/// <b><see langword="continue"/>;</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class Continue : Internal.Keyword<Continue>
|
public sealed class Continue : Internal.Keyword<Continue>
|
||||||
{
|
{
|
||||||
@@ -133,7 +133,7 @@ namespace Convention.Symbolization.Keyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <b><see langword="struct"/> structureName</b>
|
/// <b><see langword="struct"/> structureName { ... }</b>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class Structure : Internal.Keyword<Structure>
|
public sealed class Structure : Internal.Keyword<Structure>
|
||||||
{
|
{
|
||||||
|
38
Convention/[Symbolization]/Detail/ScriptWordVariable.cs
Normal file
38
Convention/[Symbolization]/Detail/ScriptWordVariable.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
namespace Convention.Symbolization.Internal
|
||||||
|
{
|
||||||
|
public class ScriptWordVariable : CloneableVariable<ScriptWordVariable>
|
||||||
|
{
|
||||||
|
public readonly string word;
|
||||||
|
|
||||||
|
public ScriptWordVariable(string word) : base("")
|
||||||
|
{
|
||||||
|
this.word = word;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override ScriptWordVariable CloneVariable(string targetSymbolName)
|
||||||
|
{
|
||||||
|
return new ScriptWordVariable(word);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(ScriptWordVariable other)
|
||||||
|
{
|
||||||
|
return other is not null && word.Equals(other.word);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Keyword GetKeyword()
|
||||||
|
{
|
||||||
|
if(Keyword.Keywords.TryGetValue(word, out var keyword))
|
||||||
|
return keyword;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Variable GetVariable(SymbolizationContext context)
|
||||||
|
{
|
||||||
|
if (context.Variables.TryGetValue(word, out var variable))
|
||||||
|
{
|
||||||
|
return variable;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -17,6 +17,8 @@ namespace Convention.Symbolization
|
|||||||
}
|
}
|
||||||
|
|
||||||
public readonly SymbolizationContext ParentContext;
|
public readonly SymbolizationContext ParentContext;
|
||||||
|
public readonly Dictionary<int, List<Internal.Variable>> ScriptWords = new();
|
||||||
|
public readonly Dictionary<int, List<Internal.Variable>> ScriptCommands = new();
|
||||||
public readonly Dictionary<string, Internal.Variable> Variables = new();
|
public readonly Dictionary<string, Internal.Variable> Variables = new();
|
||||||
public readonly Internal.Namespace CurrentNamespace;
|
public readonly Internal.Namespace CurrentNamespace;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user