|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.lpex.core.LpexCommonParser
com.ibm.lpex.hlasm.HLAsmParser
Document parser for HLASM (High Level Assembler).
Actions added by this document parser for selective views of the document:
Commands added by this document parser to query and set parser properties:
Field Summary | |
---|---|
protected long |
classAll
|
protected long |
classAsmMacroB
|
protected long |
classAsmMacroE
|
protected long |
classAsmMacroN
|
protected long |
classAssemIns
|
protected long |
classBackwardLink
|
protected long |
classBranch
|
protected long |
classCode
|
protected long |
classComment
|
protected long |
classContinue
|
protected long |
classError
|
protected long |
classForwardLink
|
protected long |
classLabel
|
protected long |
classMachineIns
|
protected long |
classMacroCall
|
protected long |
classOperand
|
protected long |
classOperLine
|
protected long |
classPendingOp
|
protected long |
classQString
|
protected long |
classRemark
|
protected long |
classSequence
|
protected long |
classUnknown
|
protected static int |
ITYPE_ASSEMBLER
|
protected static int |
ITYPE_ATTRIBUTES
|
protected static int |
ITYPE_MACHINE
|
protected static int |
ITYPE_REGISTERS
|
protected static int |
ITYPE_SPECIALS
|
protected static int |
ITYPE_UNDEFINED
|
protected static int |
ITYPE_USER
|
protected static OrderedInstructionList |
loaded_instructions
|
protected static boolean |
userMacrosRead
|
protected static BufferedReader |
userReader
|
Constructor Summary | |
---|---|
HLAsmParser(LpexView lpexView)
Constructor. |
Method Summary | |
---|---|
void |
clearInstructionTable()
Removes all the instructions from the static instruction table. |
String |
convertCaseToString(int level)
|
protected void |
createInstruction(int type,
String lineX)
This method is called when the instruction table is created. |
boolean |
getBranchColoring()
|
String |
getBranchColoringString()
|
int |
getCaseSensitivityLevel()
|
String |
getCaseSensitivityLevelString()
|
String |
getCommentStyleCharacters()
Returns the style characters used for styling comments and remarks ("cr"). |
static InstrColorAssoc |
getCustomColorAssociations()
|
static String |
getCustomColorFileLocation()
|
protected IFileLocator |
getFileLocator()
Returns the file locator being used by this HLASM parser. |
String |
getInitialCommands()
|
boolean |
getInstructionColoring()
|
String |
getInstructionColoringString()
|
protected static char |
getInstructionsSpecialColor(String name)
When parsing a file, this method can be used to see if there has been a custom color set for the instruction. |
String |
getLanguage()
Returns "HLASM" as the language supported by the HLASM and TPF HLASM document parsers. |
static char |
getNextValidColorChar()
Returns the next character that can be used to define a custom color. |
String |
getParserPropertiesFileName()
Returns the HLASM parser profile name. |
protected String |
getPopupItems(int popupLocation)
Returns this parser's contribution to the pop-up menu. |
ResourceBundle |
getProfile()
Returns the document parser's profile resource bundle. |
String |
getPropertyDefault(String key)
This method will get the default value for the given key. |
protected int |
getTypeOfTag(String tag)
This method is called when the instruction table is being loaded. |
protected void |
loadCustomInstructionColors(String xml_file,
boolean reload)
Load a user XML file containing custom color settings. |
void |
loadInstrTable()
Loads the static table(s) of supported instructions, registers, etc. |
String |
nextInstruction()
Retrieve the next instruction-format line. |
void |
parseAll()
Total parse of the entire document. |
protected void |
parseAllOpenFiles()
Reparses all open views of HLASM parser files. |
void |
parseElement(int changedElement)
Incremental parse. |
void |
performReParse()
When variables change that will affect how the current document is parsed, a reparse should be performed. |
protected static void |
resetColorCharacters()
Resets the valid color character counter. |
protected static String |
retrieveMessage(String key,
String sub)
Retrieves a message with an optional substitution argument. |
void |
setBranchColoring(boolean state_on,
boolean update,
boolean re_parse)
If the state has changed this method will make the required adjustements. |
void |
setBranchColoringString(String state,
boolean update,
boolean re_parse)
The method can be used to change the state of the branch coloring feature. |
void |
setCaseSensitivityLevel(int i_case_level,
boolean update,
boolean re_parse)
|
void |
setCaseSensitivityLevelString(String s_case_level,
boolean update,
boolean re_parse)
The case level is a file-scoped variable. |
void |
setCustomColorFileLocation(String fileName,
boolean color_file_updated,
boolean update,
boolean re_parse)
This method is used to set the location of the user provided XML file. |
protected void |
setDefaultPreferences()
Retrieves parser properties from the storage location and uses those defaults to set initial parser values. |
static void |
setFileLocator(IFileLocator fileLocator)
Sets a file locator for the HLASM parsers. |
void |
setInitialCommands(String command_string,
boolean update,
boolean reparse)
The initial commands is a set of commands that should be run each time a file using this parser is opened. |
void |
setInstructionColoring(boolean state_on,
boolean update,
boolean re_parse)
This method is used to turn the special instruction coloring feature on and off. |
void |
setInstructionColoringString(String state,
boolean update,
boolean re_parse)
This method is used to turn the special instruction coloring feature on and off. |
void |
setStyleAttributes()
Defines parser's style attributes. |
void |
terminateParser()
The parser is terminated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected long classContinue
protected long classForwardLink
protected long classBackwardLink
protected long classCode
protected long classComment
protected long classError
protected long classSequence
protected long classQString
protected long classRemark
protected long classOperand
protected long classPendingOp
protected long classOperLine
protected long classMachineIns
protected long classAssemIns
protected long classLabel
protected long classBranch
protected long classUnknown
protected long classAsmMacroB
protected long classAsmMacroE
protected long classAsmMacroN
protected long classMacroCall
protected long classAll
protected static OrderedInstructionList loaded_instructions
protected static boolean userMacrosRead
protected static BufferedReader userReader
protected static final int ITYPE_UNDEFINED
protected static final int ITYPE_MACHINE
protected static final int ITYPE_ASSEMBLER
protected static final int ITYPE_SPECIALS
protected static final int ITYPE_REGISTERS
protected static final int ITYPE_ATTRIBUTES
protected static final int ITYPE_USER
Constructor Detail |
public HLAsmParser(LpexView lpexView)
lpexView
- the LPEX document view associated with this parserMethod Detail |
public void terminateParser()
When the parser is being disposed, we remove it from the global list of HLASM parsers. This list is maintained so that when a global property is changed, all parser instances can be updated to reflect the changes.
terminateParser
in class LpexCommonParser
protected void setDefaultPreferences()
protected void loadCustomInstructionColors(String xml_file, boolean reload)
xml_file
- the name and path of the XML file
containing the color associationsreload
- true = you are reloading the file; or
false = you are just checking whether it needs to be
loaded, or loading for the first timepublic ResourceBundle getProfile()
getProfile
in class LpexCommonParser
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiespublic String getParserPropertiesFileName()
public void performReParse()
public String getLanguage()
getLanguage
in class LpexCommonParser
LpexCommonParser.LANGUAGE_HLASM
protected static String retrieveMessage(String key, String sub)
key
- the key of the message in the parser profilesub
- a substitution variable to insert into the string, or
null if none
protected String getPopupItems(int popupLocation)
getPopupItems
in class LpexCommonParser
popupLocation
- the location on the pop-up menu of the items
requested, one of: LpexCommonParser.POPUP_TOP
, LpexCommonParser.POPUP_FILTERVIEW
,
LpexCommonParser.POPUP_SOURCE
, LpexCommonParser.POPUP_END
null
if noneLpexCommonParser.defineFilterAction(java.lang.String, java.lang.String)
public void setStyleAttributes()
'_'
(layout blanks),
'z'
(default text),
't'
(special symbol/character),
'c'
(line comment),
'r'
(statement remark),
'x'
(error),
'n'
(single-quoted string),
'p'
(statement name/label),
'v'
(sequence information),
'q'
(machine instruction),
'a'
(assembler instruction),
'w'
(continuation character).
public String getCommentStyleCharacters()
getCommentStyleCharacters
in class LpexCommonParser
public void parseAll()
parseAll
in class LpexCommonParser
public void parseElement(int changedElement)
parseElement
in class LpexCommonParser
changedElement
- an element whose committed change triggered the parse,
or the element that precedes / follows a deleted block.
The parser may identify other neighbouring elements that
will have to be reparsed as a unitLpexView.parsePending(int)
,
LpexView.elementParsed(int)
,
Total and incremental parsepublic void loadInstrTable()
public void clearInstructionTable()
protected int getTypeOfTag(String tag)
tag
- a tag found in a data file (user or hard coded),
e.g., "[MACHINE]"
null
to indicate no match was foundprotected void createInstruction(int type, String lineX)
type
- lineX
- public String nextInstruction()
null
.
The method can be extended by a subclassing parser to add custom macros/instructions.
protected void parseAllOpenFiles()
public static char getNextValidColorChar()
protected static void resetColorCharacters()
protected static char getInstructionsSpecialColor(String name)
name
- the name of the instruction in question
public void setCaseSensitivityLevelString(String s_case_level, boolean update, boolean re_parse)
s_case_level
- the case level must be one of three values:
update
- changes should be made so they take effect immediately.
There are currently no "update" specific functions for the case level change.re_parse
- should a reparse, if required, be performed now.
The reparse will be needed before changes take effect, however if there
are multiple changes being made then set update to true and reparse to
false and then reparse laterpublic void setCaseSensitivityLevel(int i_case_level, boolean update, boolean re_parse)
i_case_level
- the new case levelupdate
- changes should be made so they take effect immediately.
There are currently no "update" specific functions for the case level change.re_parse
- should a reparse, if required, be performed now.
The reparse will be needed before changes take effect, however if there
are multiple changes being made then set update to true and reparse to
false and then reparse latersetCaseSensitivityLevelString(java.lang.String, boolean, boolean)
public String getCaseSensitivityLevelString()
public int getCaseSensitivityLevel()
public void setBranchColoringString(String state, boolean update, boolean re_parse)
state
- TRUE - The branch color feature will either be turned on or
remain on. If the feature was previously off the document will be parsed
so that any existing invalid labels are colored red.update
- - The update variable indicates that changes should be made so the
changes can be made immediatly. When the branch feature state changes, updates include
re-builing / clearing the label table.re_parse
- - If a re-parse is required, this variable will be checked to see
if it should be performed now. The re-parse will be needed before changes take effect
however if there are multiple changes being made then set update to true and reparse to
false and then re-parse later.public void setBranchColoring(boolean state_on, boolean update, boolean re_parse)
state_on
- - A boolean indicating the new state for the variable.update
- - The update variable indicates that changes should be made so the
changes can be made immediatly. When the branch feature state changes, updates include
re-builing / clearing the label table.re_parse
- - If a re-parse is required, this variable will be checked to see
if it should be performed now. The re-parse will be needed before changes take effect
however if there are multiple changes being made then set update to true and reparse to
false and then re-parse later.setBranchColoringString(java.lang.String, boolean, boolean)
public String getBranchColoringString()
public boolean getBranchColoring()
public void setInstructionColoringString(String state, boolean update, boolean re_parse)
state
- "on" = turn the feature on - if the feature was previously off, a reparse is
performed; or
"off" = turn the feature off - if the feature was previously on, a reparse
is used to un-color any colored labelsupdate
- the update variable indicates that changes should be made so the
changes can be made immediatly. Updates for the instruction color state changes
will include re-loading the custom color filere_parse
- if a reparse is required, this variable will be checked to see
if it should be performed now. The re-parse will be needed before changes take effect
however if there are multiple changes being made then set update to true and reparse to
false and then reparse laterpublic void setInstructionColoring(boolean state_on, boolean update, boolean re_parse)
state_on
- true = turn the feature on. If the feature was previously off,
a reparse is performed;
false = turn the feature off. If the feature was previously on,
a reparse is done to uncolor any colored labels.update
- changes should be made so the changes become effective
immediately. Updates for the instruction color state changes
will include reloading the custom color file.re_parse
- if a reparse is required, this argument is checked to see
if it should be performed now. The reparse will be needed before
changes take effect, however if there are multiple changes being
made then set update to true and reparse to false, and then
reparse later.public String getInstructionColoringString()
public boolean getInstructionColoring()
public void setCustomColorFileLocation(String fileName, boolean color_file_updated, boolean update, boolean re_parse)
fileName
- the name of the XML file containing color definitions.
If the coloring feature is currently on, changing the color file will
cause a reparse with the new colors in the newly provided filecolor_file_updated
- if the content of the file has changed and needs
to be refreshed, this variable should be true, otherwise the file will
only be loaded if the name has changedupdate
- when the location of the color file changes the instruction table
needs to be changed to use the new colors. If update is true this
update to static parser variables will be made. Otherwise the change
is saved to the .properties file but has no affect on any files.re_parse
- if the color file has been reread then the document should be
reparsed. Because the file location is a global setting. All documents
should be reparsed to pick up the new setting. If this variable is true,
all documents including this one will be reparsed when it is needed. If it
is false, no documents are reparsedpublic static String getCustomColorFileLocation()
public static InstrColorAssoc getCustomColorAssociations()
public void setInitialCommands(String command_string, boolean update, boolean reparse)
command_string
- a string of commands to be stored in the .properties
file where each command is separated by ";" (semicolon)update
- if true, the commands will be issued now, otherwise the commands
are saved but not isssued; when the commands are issued,
they will be issued to all open parsersreparse
- ignoredpublic String getInitialCommands()
public static void setFileLocator(IFileLocator fileLocator)
getFileLocator()
protected IFileLocator getFileLocator()
setFileLocator(IFileLocator)
public String getPropertyDefault(String key)
key
- the idendifier for the value to be retrieved
public String convertCaseToString(int level)
|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |