public bool ReplaceByIdentifiers(MacroDefinition.ArgumentElement[] identifiers, Macrocall.OperandElement[] values, List <AssembleError> errorList) { int matchIdx; if (!Content.MatchIdentifier(identifiers, out matchIdx)) { return(false); } /* * if (values[matchIdx].Type != Macrocall.enumOperandType.Immediate) * { //Error * errorList.Add(new Assemble.AssembleError() * { * Title = "Replacement", * Detail = "Register number cannot be used for symbol refering target.", * Position = this.AssemblePosition * }); * return false; * } */ //Replace this.Content = values[matchIdx].Immediate.Clone(DefinedBlock); return(true); }
public bool IsMatchByContent(ValueBase v) { if (!this.Content.Equals(v)) { return(false); } return(true); }
public bool ReplaceByIdentifiers(MacroDefinition.ArgumentElement[] identifiers, Macrocall.OperandElement[] values, List <AssembleError> errorList) { int matchIdx; if (!Immediate.MatchIdentifier(identifiers, out matchIdx)) { return(true); } Immediate = values[matchIdx].Immediate.Clone(WrittenInstruction.WrittenBlock); return(true); }
public bool FindReadonlyElement(ValueBase val, out ReadonlyElement res) { foreach (var e in Readonlys) { if (!e.IsMatchByContent(val)) { continue; } res = e; return(true); } res = null; return(false); }
public override bool Equals(ValueBase val) { return(val.Equals(this)); }