예제 #1
0
    def __init__(self, string, source, ndx, onum):
        assert string is not None,\
            "LOperand 'string' argument must be a string: %s" % string
        assert len(string) >= 1, "LOperand 'string' argument must not be empty"
        super().__init__(string, asmbase.ASMPLoc(source, ndx))

        self.onum = onum  # Operand number in the logical line
예제 #2
0
    def __init__(self, pline):
        assert isinstance(pline,asminput.PhysLine),\
            "%s 'pline' argument must be an asminput.PhysLine object: %s" \
                % (assembler.eloc(self,"__init__",module=this_module),pline)
        assert pline.operand_start is not None,\
            "%s 'pline.operand_start' must not be None" \
                % assembler.eloc(self,"__init__",module=this_module)

        text = pline.text[pline.operand_start:]
        amp = "&" in text
        loc = asmbase.ASMPLoc(source=pline.source, pndx=pline.operand_start)

        super().__init__(text, start=loc, amp=amp)
예제 #3
0
    def append(self, pline):
        assert isinstance(pline,asminput.PhysLine),\
            "%s 'pline' argument must be an asminput.PhysLine object: %s" \
                % (assembler.eloc(self,"__init__",module=this_module),pline)
        assert pline.operand_start is not None,\
            "%s 'pline.operand_start' must not be None" \
                % assembler.eloc(self,"__init__",module=this_module)

        loc = asmbase.ASMPLoc(source=pline.source, pndx=pline.operand_start)
        text = pline.text[pline.operand_start:]
        self.newloc(loc)
        self.text += text
        self.amp = self.amp or "&" in text
예제 #4
0
    def ACT_Add_Char(self, value, state, trace=False):
        if self.opno:
            # Adding character to current operand
            self.opno += value
            if self.new_line:
                loc = asmbase.ASMPLoc(self.source, self.cndx - 1)
                self.opno.newloc(loc)
                self.new_line = False
        else:
            # Starting a new operand
            self.new_line = False
            self.opno=LOperand(value,self.source,self.cndx-1,\
                len(self.operands)+1)

        return state.state
예제 #5
0
    def __init__(self, string, source, ndx, amp):
        assert string is not None,\
            "LField 'string' argument must be a string: %s" % string
        assert len(string) >= 1, "LField 'string' argument must not be empty"

        super().__init__(string,
                         start=asmbase.ASMPLoc(source=source, pndx=ndx),
                         amp=amp)

        self.token = None  # Resulting match lexical token
        self.symid = None  # macopnd.SymbolRef object for the field

        # Field content type
        #  'B' -> A single sysmbolic variable without a subscript or an attribute
        #  'L' -> A normal label
        #  'M' -> A macro model statement label
        #  'S' -> A symbolic variable with
        #  'Q' -> A sequence symbol
        #  'U' -> unrecognized
        self.typ = "U"  # Unrecognized type