|
LPEX 4.2.3 |
|||||||||
| 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.pli.PliParser
public class PliParser
Document parser for PL/I.
Actions added by this document parser for selective views of the document:
Keys already defined (for example, by the active base editor profile and by the user profile) to an action different from nullAction are not redefined in here.
Editor actions modified by this document parser:
LpexCommonParser.matchToken(com.ibm.lpex.core.LpexDocumentLocation)Parser properties handled directly by this parser:
SAA2)#@$)~^¬)|)bidiTODO)PROTOKEY_EMPTY -
template expansion (proto action, Ctrl+R) for an empty document and
for the following keywords is provided in this parser's profile (install
settings):do, if, select.
| Nested Class Summary | |
|---|---|
static class |
PliParser.Keyword
PL/I keyword information. |
| Field Summary | |
|---|---|
protected long |
_classAll
Element-classes aggregate. |
protected static int |
LEXER_CICS
|
protected static int |
LEXER_DLI
|
protected static int |
LEXER_OWNER
|
protected static int |
LEXER_PLI
|
protected static int |
LEXER_SQL
|
| Constructor Summary | |
|---|---|
PliParser(LpexView lpexView)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
backSpace()
Override the default backspace behaviour. |
String[] |
compileOptionKeywords()
Returns a list of the compile-time options defined in this parser. |
protected void |
delete()
Override the default delete behaviour. |
String |
getCommentStyleCharacters()
Returns the style characters used for styling comments ("c$"). |
String |
getLanguage()
Returns "PLI", the language supported by this parser (PL/I). |
String |
getLanguage(LpexDocumentLocation loc)
Returns a string identifying the language segment at the specified location. |
int |
getLeftMargin()
Returns the left margin used to parse the document. |
protected LpexSubparser |
getLexer(int lexer,
LpexCharStream lexerStream)
Returns the specified subparser. |
String |
getLshToken()
Returns the current token for language-sensitive help (LSH). |
String |
getNamesCharacters()
Returns the extra characters for names used in the parsing of this document. |
String |
getNotCharacters()
Returns the characters for the logical NOT operator used in the parsing of this document. |
String |
getOrCharacters()
Returns the characters for the logical OR operator used in the parsing of this document. |
protected String |
getPopupItem(String key)
|
protected String |
getPopupItems(int popupLocation)
Returns this parser's contribution to the popup. |
ResourceBundle |
getProfile()
Returns this parser's profile resource bundle. |
String |
getProperty(String key)
Extends LpexCommonParser's getProperty() to substitute the arguments for key PROTOKEY_EMPTY. |
int |
getRightMargin()
Returns the right margin used to parse the document. |
protected LpexCharStream |
getStream()
Returns the character stream used by the parser. |
protected boolean |
hasOwnerSubparser()
Returns the availability of an owner subparser. |
protected void |
initParser()
Initializes the parser. |
protected PliParser.Keyword |
isKeyword(Token token)
Returns whether the given token is a non compile-option PL/I keyword. |
protected PliParser.Keyword |
isKeyword(Token token,
int attribute)
Returns whether the given token is a PL/I keyword of a particular attribute. |
protected boolean |
isOwnerElement(int element)
Returns whether the specified text element should be parsed by the custom lexer (LEXER_OWNER). |
boolean |
isTokenDelimiter(char ch)
Returns whether the specified character is a token delimiter. |
protected int |
join()
Override the default join behaviour. |
protected int |
join(boolean undoCheck)
Override the default join behaviour. |
String[] |
keywords()
Returns a list of the PL/I keywords defined in this parser. |
protected LpexDocumentLocation |
matchToken(LpexDocumentLocation loc)
Matches PL/I constructs (e.g., "PROC" - "END"). |
protected String |
nextKeyword()
Retrieves the next keyword-definition line. |
void |
parseAll()
Total parse of the entire document. |
void |
parseElement(int element)
Incremental parse. |
protected void |
propertySet(String key)
Listens to changes to the taskTags parser property in this view. |
protected void |
setLineStructure()
(Re)sets the format line and the editing fields for the left and right margins in effect. |
void |
setStyleAttributes()
Defines parser's style attributes. |
protected void |
splitLine()
Override the default splitLine behaviour. |
protected void |
splitLine(boolean undoCheck)
Override the default splitLine behaviour. |
protected void |
terminateParser()
Cleans up any resources allocated by this parser. |
| Methods inherited from class com.ibm.lpex.core.LpexCommonParser |
|---|
addDocumentMessage, addMessage, addMessage, addMessage, blockMarkWord, copyDocumentMessages, cursorIndent, defineFilterAction, defineFilterAction, expandProtoKeyword, getInstallStyleAttributes, getStyleName, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, isPrimaryParser, isWordCharacter, lineComment, lpexView, newLine, openLine, parse, removeDocumentMessages, removeMessages, removeMessages, resetParser, setProperty, setStyle, styleString, tokenBegin, tokenEnd, totalParse |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long _classAll
protected static final int LEXER_PLI
protected static final int LEXER_SQL
protected static final int LEXER_CICS
protected static final int LEXER_DLI
protected static final int LEXER_OWNER
| Constructor Detail |
|---|
public PliParser(LpexView lpexView)
lpexView - the LPEX document view associated with this parser| Method Detail |
|---|
protected void initParser()
initParser in class LpexCommonParserprotected void splitLine()
splitLine in class LpexCommonParserLpexCommonParser.getTextIndent(int)protected void splitLine(boolean undoCheck)
undoCheck - set undo checkpoints within the actionprotected int join()
protected int join(boolean undoCheck)
undoCheck - set undo checkpoints within the action
protected void backSpace()
protected void delete()
public void parseAll()
parseAll in class LpexCommonParserpublic void parseElement(int element)
parseElement in class LpexCommonParserelement - an element affected by a committed change in this viewLpexView.parsePending(int),
LpexView.elementParsed(int),
Total and incremental parsepublic ResourceBundle getProfile()
getProfile in class LpexCommonParserLpexCommonParser.getProperty(java.lang.String),
Parser propertiespublic String getLanguage()
getLanguage in class LpexCommonParserLpexCommonParser.LANGUAGE_PLIpublic String getLanguage(LpexDocumentLocation loc)
getLanguage in class LpexCommonParserloc - document location
LpexCommonParser.getLanguage(),
Mixed content documentsprotected void terminateParser()
terminateParser in class LpexCommonParserprotected void propertySet(String key)
propertySet in class LpexCommonParserkey - base name of the parser property that was set, for example "autoIndent"LpexCommonParser.setProperty(String,String),
LpexCommonParser.getProperty(java.lang.String),
Parser propertiesprotected String getPopupItems(int popupLocation)
getPopupItems in class LpexCommonParserpopupLocation - 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)protected String getPopupItem(String key)
public void setStyleAttributes()
'_' (layout blanks),
'a' (variable/procedure name),
'u' (label),
's' (language symbol),
'g' (extension),
'?' (outside margins),
'c' (comment),
'$' (comment task tag),
'e' (error),
'k' (keyword),
'b' (built-in function),
'n' (numeric),
'l' (literal),
'q' (preprocessor keyword),
'r' (preprocessor '?').
public String getCommentStyleCharacters()
getCommentStyleCharacters in class LpexCommonParserprotected LpexDocumentLocation matchToken(LpexDocumentLocation loc)
matchToken in class LpexCommonParserloc - document location of the token to match
loc adjusted to include
the entire original token), or
null if not a matchable token, or
original loc if no match found for the tokenpublic boolean isTokenDelimiter(char ch)
isTokenDelimiter in class LpexCommonParserch - character queried, for example ')'LpexCommonParser.getToken(com.ibm.lpex.core.LpexDocumentLocation),
LpexCommonParser.tokenBegin(com.ibm.lpex.core.LpexDocumentLocation),
LpexCommonParser.tokenEnd(com.ibm.lpex.core.LpexDocumentLocation)protected final LpexCharStream getStream()
protected String nextKeyword()
null.
This method may be extended by a subclassing parser to add custom keywords.
public String getLshToken()
In addition to language keywords, this parser generates the following 'tokens' for special situations:
getLshToken in class LpexCommonParserpublic String getProperty(String key)
getProperty in interface LpexParsergetProperty in class LpexCommonParserkey - property name, for example, "proto.doc" for this parser's expansion
of the keyword "doc" by the proto action, or
"view.proto.doc" for this property as defined in the current view's
instance of the parserLpexCommonParser.getLanguage(),
LpexCommonParser.getProfile(),
Parser propertiespublic int getLeftMargin()
public int getRightMargin()
public String getNotCharacters()
public String getOrCharacters()
public String getNamesCharacters()
protected void setLineStructure()
public String[] compileOptionKeywords()
keywordspublic String[] keywords()
compileOptionKeywords()protected PliParser.Keyword isKeyword(Token token)
token - token to check
null if it is not a PL/I keyword
protected PliParser.Keyword isKeyword(Token token,
int attribute)
token - token to checkattribute - its attribute
null if it is not a PL/I keyword of this attributeprotected boolean hasOwnerSubparser()
The default implementation of this method returns false.
protected boolean isOwnerElement(int element)
The default implementation of this method returns false.
protected LpexSubparser getLexer(int lexer,
LpexCharStream lexerStream)
The default implementation of this method returns null for LEXER_DLI and LEXER_OWNER requests.
lexer - lexer requested, one of LEXER_SQL, LEXER_CICS,
LEXER_DLI, LEXER_OWNERlexerStream - input character stream for the lexer
|
LPEX 4.2.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||