mirror of
https://github.com/creeperlv/SVM.git
synced 2026-01-11 04:49:53 +00:00
Working on the assembler.
This commit is contained in:
@@ -68,6 +68,7 @@ LabelConstant InternalLbl
|
|||||||
lexer.Content = input;
|
lexer.Content = input;
|
||||||
lexer.SourceID = ID;
|
lexer.SourceID = ID;
|
||||||
OperationResult<IntermediateObject> operationResult = new OperationResult<IntermediateObject>();
|
OperationResult<IntermediateObject> operationResult = new OperationResult<IntermediateObject>();
|
||||||
|
InternalLabel CurrentLabel = InternalLabel.Code;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
var lexResult = lexer.Lex();
|
var lexResult = lexer.Lex();
|
||||||
@@ -76,8 +77,40 @@ LabelConstant InternalLbl
|
|||||||
switch (r.LexSegmentId)
|
switch (r.LexSegmentId)
|
||||||
{
|
{
|
||||||
case "InternalLbl":
|
case "InternalLbl":
|
||||||
|
switch (r.LexMatchedItemId)
|
||||||
|
{
|
||||||
|
case "LabelCode":
|
||||||
|
CurrentLabel = InternalLabel.Code;
|
||||||
|
break;
|
||||||
|
case "LabelData":
|
||||||
|
CurrentLabel = InternalLabel.Data;
|
||||||
|
break;
|
||||||
|
case "LabelConstant":
|
||||||
|
CurrentLabel = InternalLabel.Const;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
switch (CurrentLabel)
|
||||||
|
{
|
||||||
|
case InternalLabel.Code:
|
||||||
|
switch (r.LexSegmentId)
|
||||||
|
{
|
||||||
|
case "GenericLabel":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case InternalLabel.Data:
|
||||||
|
break;
|
||||||
|
case InternalLabel.Const:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,10 +118,15 @@ LabelConstant InternalLbl
|
|||||||
return operationResult;
|
return operationResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public enum InternalLabel
|
||||||
|
{
|
||||||
|
Code, Data, Const
|
||||||
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class IntermediateObject
|
public class IntermediateObject
|
||||||
{
|
{
|
||||||
public Dictionary<string, string> data = new Dictionary<string, string>();
|
public Dictionary<string, string> data = new Dictionary<string, string>();
|
||||||
|
public Dictionary<string, string> consts = new Dictionary<string, string>();
|
||||||
public List<IntermediateInstruction> instructions = new List<IntermediateInstruction>();
|
public List<IntermediateInstruction> instructions = new List<IntermediateInstruction>();
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="LibCLCC.NET" Version="1.32.33" />
|
<PackageReference Include="LibCLCC.NET" Version="1.33.34" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user