Esempio n. 1
0
func (assembler *LineList) ParseRAdrX(currentLine string) error {
	source := token.NewSource(currentLine)
	temp := line.NewRAdrX()
	err := temp.Parse(source)
	if err != nil {
		return err
	}
	assembler.Lines = append(assembler.Lines, temp)
	return nil
}
Esempio n. 2
0
func TestRAdrXParse(t *testing.T) {
	testCaseList := []testCaseForTestRAdrXParse{
		{data: `     ADDA  GR0, ADR1, GR1`},
		{data: `     SUBA GR0, ADR1, GR1	; COMMENT`},
		{data: `LABEL     SRL GR0, ADR1, GR1	; COMMENT`},
	}
	for _, testCase := range testCaseList {
		testData := testCase.data
		radrx := line.NewRAdrX()
		source := token.NewSource(testData)
		err := radrx.Parse(source)
		if err != nil {
			t.Error(err)
		}
		// t.Error(radrx)
	}
}