/// <inheritdoc /> protected override IEnumerable <GrammerDefinition> TypeDefinitions() { var typeDefinitions = base.TypeDefinitions().ToDictionary(g => g.Name); typeDefinitions["DOUBLE"] = new OperandDefinition("DOUBLE", "\\-?\\d+\\.?\\d*", x => (Expression)Expression.Constant(double.Parse(x))); return(typeDefinitions.Values); }
public InstructionDefinition ToInstructionDefinition() { if (IsPseudo) throw new InvalidOperationException(); var data = new InstructionDefinition.Data(); data.Mnemonic = mnemonic; EncodingParser.Parse(encodingTokens, vexEncoding, out data.Opcode, out data.Encoding); var operandDefs = new OperandDefinition[operands.Count]; for (int i = 0; i < operands.Count; ++i) operandDefs[i] = operands[i].ToOperandDefinition(); return new InstructionDefinition(ref data, operandDefs); }