Simplified the lexer definition.

This commit is contained in:
2025-08-04 06:50:09 +10:00
parent a8b526c645
commit 97e3ce81eb
2 changed files with 29 additions and 18 deletions

View File

@@ -14,15 +14,6 @@ namespace SVM.Assembler.Core
@" @"
Match: Match:
InstMath bmath
InstSDInt32 sd\.int32
InstSDInt sd\.int
InstSDInt64 sd\.int64
InstSDLong sd\.long
InstCvt cvt
InstSystem system
InstSys sys
InstSD sd
Register \${D}+ Register \${D}+
LabelCode \.code\: LabelCode \.code\:
LabelData \.data\: LabelData \.data\:
@@ -37,15 +28,6 @@ D \d
Id: Id:
word Word word Word
InstSDInt64 inst
InstSDLong inst
InstMath inst
InstSDInt inst
InstSDInt32 inst
InstCvt inst
InstSystem inst
InstSys inst
InstSD sd
string String string String
Number Number Number Number
Register Register Register Register

View File

@@ -140,5 +140,34 @@
</InstructionParameter> </InstructionParameter>
</Parameters> </Parameters>
</InstructionDefinition> </InstructionDefinition>
<InstructionDefinition Id="save" PrimaryInstruction="Save" InstructionCount="1">
<Aliases>
<Alias Name="save"/>
<Alias Name="sd"/>
</Aliases>
<Parameters>
<InstructionParameter>
<MatchingItems>
<Item Id="Register"/>
<Item Id="Word"/>
</MatchingItems>
<ExpectedValue Type="UInt8" Pos="1" Converter="Register" />
</InstructionParameter>
<InstructionParameter>
<MatchingItems>
<Item Id="Number"/>
<Item Id="Word"/>
</MatchingItems>
<ExpectedValue Type="UInt8" Pos="2" Converter="UInt8" />
</InstructionParameter>
<InstructionParameter>
<MatchingItems>
<Item Id="Register"/>
<Item Id="Word"/>
</MatchingItems>
<ExpectedValue Type="UInt8" Pos="3" Converter="Register" />
</InstructionParameter>
</Parameters>
</InstructionDefinition>
</Definitions> </Definitions>
</ISARoot> </ISARoot>