Exemplo n.º 1
0
 def parse_DEC(self, context, operands):
     if operands:
         op = Decimal(" ".join(operands))
         if op.isValid():
             context.currentRecord.code = [op.value]
             context.currentRecord.operandType = RecordType.CONST
             context.currentRecord.complete = True
         else:
             context.syntax("DEC operand must be a decimal number")
Exemplo n.º 2
0
 def parse_DEC(self, context, operands):
     if operands:
         op = Decimal(" ".join(operands))
         if op.isValid():
             context.currentRecord.code = [ op.value ]
             context.currentRecord.operandType = RecordType.CONST
             context.currentRecord.complete = True
         else:
             context.syntax("DEC operand must be a decimal number")
Exemplo n.º 3
0
 def parse_VN(self, context, operands):
     if operands:
         op = Decimal(operands[0])
         if op.isValid():
             lower = int(operands[0][-2:])
             upper = int(operands[0][:-2])
             context.currentRecord.code = [upper * 128 + lower]
             context.currentRecord.operandType = RecordType.CONST
             context.currentRecord.complete = True
         else:
             context.syntax("operand must be a decimal number")
Exemplo n.º 4
0
 def parse_VN(self, context, operands):
     if operands:
         op = Decimal(operands[0])
         if op.isValid():
             lower = int(operands[0][-2:])
             upper = int(operands[0][:-2])
             context.currentRecord.code = [ upper * 128 + lower ]
             context.currentRecord.operandType = RecordType.CONST
             context.currentRecord.complete = True
         else:
             context.syntax("operand must be a decimal number")