tools.processor
Class Mnemonic

java.lang.Object
  extended by tools.processor.Mnemonic

public class Mnemonic
extends java.lang.Object

This class encapsulates an opcode mnemonic that may have multiple forms. A mnemonic is a human readable form of an opcode. For instance, "09EEwmwl" might be represented with "LDX #w". There may be multiple forms of a single mnemonic. For instance, in the 6809 the "BCC" (branch if carry clear) and "BHS" (branch if higher or the same) are exactly the same. The programmer can pick either form. Thus the mnemonic representation here includes collections for multiple forms. Mnemonics are lists of two types of tokens: Absolute text matches like "LDX #" in the above example Place holders for numbers like "w" in the above example This class assumes that a text representation of the mnemonic assumes that numeric-fill-ins are represented with single-lower-case-letters. The mnemonics are parsed into tokens here. For instance, a line like "A=A+PORT[b+i]" would result in the following tokens: "A=A+PORT[b" ... b ... "+" ... i ... "]" MATCH NUMBER MATCH NUMBER MATCH


Constructor Summary
Mnemonic(java.lang.String text)
          This constructs a new mnemonic by parsing the text representations (separated with ";".
 
Method Summary
 java.util.List<java.util.List<MnemonicParseToken>> getParseTokens()
          This method returns the parse tokens for all the text representations for a single mnemonic.
 java.lang.String[] getTextRepresentations()
          This method returns all the text representations for a single mnemonic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Mnemonic

public Mnemonic(java.lang.String text)
This constructs a new mnemonic by parsing the text representations (separated with ";". Numeric fill-ins are single lower-case letters.

Parameters:
text - the combined mnemonic representation
Method Detail

getTextRepresentations

public java.lang.String[] getTextRepresentations()
This method returns all the text representations for a single mnemonic.

Returns:
the text representations for a single mnemonic.

getParseTokens

public java.util.List<java.util.List<MnemonicParseToken>> getParseTokens()
This method returns the parse tokens for all the text representations for a single mnemonic.

Returns:
the list of parse tokens ... one list for each representation