|
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.pli.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
)#@$
)~^¬
)|
)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
.
Field Summary | |
---|---|
protected static int |
LEXER_CICS
Identifier for the embedded EXEC CICS statements lexer. |
protected static int |
LEXER_DLI
Identifier for the embedded EXEC DLI statements lexer. |
protected static int |
LEXER_PLI
Identifier for the PL/I lexer (subparser). |
protected static int |
LEXER_SQL
Identifier for the embedded EXEC SQL statements lexer. |
Constructor Summary | |
---|---|
PliParser(LpexView lpexView)
Constructor for the parser. |
Method Summary | |
---|---|
String[] |
compileOptionKeywords()
Returns a list of the compile-time options defined in this parser. |
String |
getCommentStyleCharacters()
Returns the style character 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()
Get 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 |
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 com.ibm.lpex.pli.Keyword |
isKeyword(com.ibm.lpex.cc.Token token)
Returns whether the given token is a non compile-option PL/I keyword. |
protected com.ibm.lpex.pli.Keyword |
isKeyword(com.ibm.lpex.cc.Token token,
int attribute)
Returns whether the given token is a PL/I keyword of a particular attribute. |
boolean |
isTokenDelimiter(char ch)
Returns whether the specified character is a token delimiter. |
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. |
void |
setStyleAttributes()
Defines parser's style attributes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int LEXER_PLI
protected static final int LEXER_SQL
protected static final int LEXER_CICS
protected static final int LEXER_DLI
Constructor Detail |
public PliParser(LpexView lpexView)
lpexView
- the LPEX document view associated with this parserMethod Detail |
public void parseAll()
parseAll
in class LpexCommonParser
public void parseElement(int element)
parseElement
in class LpexCommonParser
element
- an element affected by a committed change in this viewLpexView.parsePending(int)
,
LpexView.elementParsed(int)
,
Total and incremental parsepublic ResourceBundle getProfile()
getProfile
in class LpexCommonParser
LpexCommonParser.getProperty(java.lang.String)
,
Parser propertiespublic String getLanguage()
getLanguage
in class LpexCommonParser
LpexCommonParser.LANGUAGE_PLI
public String getLanguage(LpexDocumentLocation loc)
getLanguage
in class LpexCommonParser
loc
- document location
LpexCommonParser.getLanguage()
,
Mixed content documentsprotected 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),
'a'
(variable/procedure name),
'u'
(label),
's'
(language symbol),
'g'
(extension),
'?'
(outside margins),
'c'
(comment),
'e'
(error),
'k'
(keyword),
'b'
(built-in function),
'n'
(numeric),
'l'
(literal),
'q'
(preprocessor keyword),
'r'
(preprocessor '?').
public String getCommentStyleCharacters()
getCommentStyleCharacters
in class LpexCommonParser
protected LpexDocumentLocation matchToken(LpexDocumentLocation loc)
matchToken
in class LpexCommonParser
loc
- 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 LpexCommonParser
ch
- character queried, for example, ')'LpexCommonParser.getToken(com.ibm.lpex.core.LpexDocumentLocation)
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 LpexCommonParser
public String getProperty(String key)
getProperty
in interface LpexParser
getProperty
in class LpexCommonParser
key
- 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()
public String[] compileOptionKeywords()
keywords()
public String[] keywords()
compileOptionKeywords()
protected com.ibm.lpex.pli.Keyword isKeyword(com.ibm.lpex.cc.Token token)
token
- token to check
null
if it is not a PL/I keywordprotected com.ibm.lpex.pli.Keyword isKeyword(com.ibm.lpex.cc.Token token, int attribute)
token
- token to checkattribute
- its attribute
null
if it is not a PL/I keyword of this attributeprotected LpexSubparser getLexer(int lexer, LpexCharStream lexerStream)
The default implementation of this method currently returns null for a LEXER_DLI request.
lexer
- lexer requested (LEXER_SQL
/ LEXER_CICS
/ LEXER_DLI
)lexerStream
- input character stream for the lexer
|
SWT LPEX v3.0.5 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |