LPEX
3.6.8

com.ibm.lpex.fortran
Class FortranFixedFormParser

java.lang.Object
  extended by com.ibm.lpex.core.LpexCommonParser
      extended by com.ibm.lpex.fortran.FortranParser
          extended by com.ibm.lpex.fortran.FortranFixedFormParser
All Implemented Interfaces:
LpexConstants, LpexParser

public class FortranFixedFormParser
extends FortranParser

Document parser for fixed source form Fortran. It extends the base FortranParser to use a fixed source form lexer FixedFormLexer.

Parser property handled directly by this parser:


Field Summary
 
Fields inherited from class com.ibm.lpex.core.LpexCommonParser
ATTRIBUTES_COMMENT, ATTRIBUTES_COMMENT_KEYWORD, ATTRIBUTES_COMMENT1, ATTRIBUTES_DEFAULT, ATTRIBUTES_DIRECTIVE, ATTRIBUTES_ERROR, ATTRIBUTES_ERROR1, ATTRIBUTES_KEYWORD, ATTRIBUTES_KEYWORD1, ATTRIBUTES_LIBRARY, ATTRIBUTES_NONSOURCE, ATTRIBUTES_NUMERAL, ATTRIBUTES_STRING, ATTRIBUTES_STRING1, BACKGROUND_COLOR, CLASS_MESSAGE, LANGUAGE_CCPP, LANGUAGE_CICS, LANGUAGE_CL, LANGUAGE_COBOL, LANGUAGE_COBOL400, LANGUAGE_COBOLILE, LANGUAGE_DDS, LANGUAGE_DLI, LANGUAGE_FORTRAN, LANGUAGE_HLASM, LANGUAGE_HTML, LANGUAGE_JAVA, LANGUAGE_JCL, LANGUAGE_LISP, LANGUAGE_PERL, LANGUAGE_PLI, LANGUAGE_REXX, LANGUAGE_RPG, LANGUAGE_RPGLEFIXED, LANGUAGE_RPGLEFREE, LANGUAGE_SABRETALK, LANGUAGE_SQL, LANGUAGE_XMI, LANGUAGE_XML, LANGUAGE_XSL, LEXER_RC_END, LEXER_RC_EOF, LEXER_RC_MORE, LEXER_RC_OK, POPUP_END, POPUP_FILTERVIEW, POPUP_SOURCE, POPUP_TOP, PROTOKEY_EMPTY, STYLE_MESSAGE, STYLE_NAME, view
 
Fields inherited from interface com.ibm.lpex.core.LpexConstants
HELP_COMMAND_MAP, LPEX_VERSION, MSG_POPUP_COMMENT, MSG_POPUP_ERRORS, MSG_POPUP_EXCLUDESELECTION, MSG_POPUP_FILTERVIEWMENU, MSG_POPUP_INSERTMENU, MSG_POPUP_SELECTEDMENU, MSG_POPUP_SHOWALL, MSG_POPUP_SOURCEMENU, MSG_POPUP_TASKS, MSG_POPUP_UNCOMMENT, PARSE_PENDING_CHANGE_MASK, PARSE_PENDING_INSERT_MASK, PARSE_PENDING_NEXT_DELETED_MASK, PARSE_PENDING_NEXT_SHOW_DELETED_MASK, PARSE_PENDING_PREV_DELETED_MASK, PARSE_PENDING_PREV_SHOW_DELETED_MASK, PARSE_PENDING_UNDO_MASK, PLATFORM_AWT, PLATFORM_SWT, PLATFORM_SWT_KEY, SHOW_ALL, SHOW_DOCUMENT, SHOW_NONE, SHOW_VIEW, STATUS_FIELDS_NOINSERT, STATUS_FIELDS_TRUNCATE, STATUS_FILE_ERRORREADING, STATUS_FILE_INCORRECTENCODING, STATUS_FILE_NOTFOUND, STATUS_FINDTEXT_INVALIDPATTERN, STATUS_FINDTEXT_NOTFOUND, STATUS_FINDTEXT_ONLYOCCURRENCE, STATUS_FINDTEXT_READONLY, STATUS_FINDTEXT_WRAPPED, STATUS_LOCATE_NOSEQUENCETEXT, STATUS_LOCATE_NOTFOUND, STATUS_LOCATE_WRAPPED, STATUS_SAVE_CANCELLED, STATUS_SAVE_FAILED, STATUS_TEXTLIMIT_ENFORCED, STATUS_TEXTLIMIT_OVERFLOW, STATUS_UNDO_NOTHINGUNDONE
 
Constructor Summary
FortranFixedFormParser(LpexView lpexView)
          Constructor.
 
Method Summary
protected  void commentUncommentLines(LpexView lpexView, boolean comment)
          Overridden to handle the fixed source form comments.
protected  int contextStartPosition(LpexView v)
          Overridden to skip the fixed source form comment indicators "C", "c", "*", and "!".
 String getCommentStyleCharacters()
          Returns the style characters used for styling comments ("cr$").
protected  IFortranLexer getFortranLexer(LpexCharStream charStream, FortranLexerStyles lexerStyles, FortranLexerClasses lexerClasses)
          Creates and returns a FixedFormLexer to be used by this parser.
 String getProperty(String key)
          Extended to return "sample.fixedForm" rather than "sample" for the preview window of the parser styles preference page.
protected  void initParser()
          Extended to initialize the tabs and the right margin.
protected  void propertySet(String key)
          Listens to changes to the fixedForm.rightMargin and fixedForm.tabs parser properties in this view.
protected  void setStyleAttributes()
          Extended to define this parser's extra style attributes.
 
Methods inherited from class com.ibm.lpex.fortran.FortranParser
getLanguage, getPopupItems, getProfile, isTokenDelimiter, parseAll, parseElement
 
Methods inherited from class com.ibm.lpex.core.LpexCommonParser
addDocumentMessage, addMessage, addMessage, addMessage, blockMarkWord, copyDocumentMessages, cursorIndent, defineFilterAction, defineFilterAction, expandProtoKeyword, getInstallStyleAttributes, getLanguage, getLshToken, getStyleName, getStyles, getTextIndent, getToken, getTokenLocation, indentText, indentText, indentText, isDebuggable, isPrimaryParser, isWordCharacter, lineComment, lpexView, matchToken, newLine, openLine, parse, removeDocumentMessages, removeMessages, removeMessages, resetParser, setProperty, setStyle, splitLine, styleString, terminateParser, tokenBegin, tokenEnd, totalParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FortranFixedFormParser

public FortranFixedFormParser(LpexView lpexView)
Constructor.

Method Detail

initParser

protected void initParser()
Extended to initialize the tabs and the right margin.

Overrides:
initParser in class FortranParser
See Also:
Life cycle

getFortranLexer

protected IFortranLexer getFortranLexer(LpexCharStream charStream,
                                        FortranLexerStyles lexerStyles,
                                        FortranLexerClasses lexerClasses)
Creates and returns a FixedFormLexer to be used by this parser.

Overrides:
getFortranLexer in class FortranParser

commentUncommentLines

protected void commentUncommentLines(LpexView lpexView,
                                     boolean comment)
Overridden to handle the fixed source form comments. These are indicated by a "C", "c", or "*" in column 1, or a "!" in any column except column 6.

Overrides:
commentUncommentLines in class FortranParser
Parameters:
comment - true = add line comments, or false = remove line comments from the start of the line's text
See Also:
LpexCommonParser.lineComment(java.lang.String, boolean)

contextStartPosition

protected int contextStartPosition(LpexView v)
Overridden to skip the fixed source form comment indicators "C", "c", "*", and "!".

Overrides:
contextStartPosition in class FortranParser

setStyleAttributes

protected void setStyleAttributes()
Extended to define this parser's extra style attributes. The following style characters are set: 'r' (inline comment), 'i' (ignored).

The debug line indicator ("D" in column 1) and conditional compilation sentinels ("!$", "C$", "c$", and "*$") are set the 'd' style character (compiler directive).

Overrides:
setStyleAttributes in class FortranParser

getCommentStyleCharacters

public String getCommentStyleCharacters()
Returns the style characters used for styling comments ("cr$").

Overrides:
getCommentStyleCharacters in class FortranParser

getProperty

public String getProperty(String key)
Extended to return "sample.fixedForm" rather than "sample" for the preview window of the parser styles preference page.

Specified by:
getProperty in interface LpexParser
Overrides:
getProperty in class LpexCommonParser
Parameters:
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 parser
See Also:
LpexCommonParser.getLanguage(), LpexCommonParser.getProfile(), Parser properties

propertySet

protected void propertySet(String key)
Listens to changes to the fixedForm.rightMargin and fixedForm.tabs parser properties in this view.

Overrides:
propertySet in class FortranParser
Parameters:
key - base name of the parser property that was set, for example "autoIndent"
See Also:
LpexCommonParser.setProperty(String,String), LpexCommonParser.getProperty(java.lang.String), Parser properties

LPEX
3.6.8

Copyright © 2013 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.