java.lang.Object
org.gjt.sp.jedit.syntax.TokenMarker
org.gjt.sp.jedit.syntax.FortranTokenMarker
- public class FortranTokenMarker
- extends TokenMarker
Custom TokenMarker for UNISYS's ASCII FORTRAN 77.
Characteristics of this dialect are:
- Fixed column format, with
- comment character ( 'C'|'c'|'*' ) in column 1,
- labels (numeric) in column 1-5,
- continuation character ( any nonblank ) in column 6,
- logical end of line after column 72.
- Nonstandard block comment character ( '@' ) in any column,
- Some nonstandard functions:
BITS, BOOL,
INDEX, TRMLEN
It should be easy enough to adapt this class for minor variations
in the dialect so long as the format is the classic fixed column format.
As this scanner is highly optimized for the fixed column format, it
is probably not readily adaptable for freeform FORTRAN code.
| Methods inherited from class org.gjt.sp.jedit.syntax.TokenMarker |
addToken, addToken, deleteLines, ensureCapacity, getLineCount, getMaxLineWidth, insertLines, isNextLineRequested, markTokens, setLineWidth, supportsMultilineTokens |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAYBE_KEYWORD_FIRST
private static final int MAYBE_KEYWORD_FIRST
- See Also:
- Constant Field Values
MAYBE_KEYWORD_MORE
private static final int MAYBE_KEYWORD_MORE
- See Also:
- Constant Field Values
S_E_P
private static final java.lang.String S_E_P
- See Also:
- Constant Field Values
fortranKeywords
private static KeywordMap fortranKeywords
keywords
private KeywordMap keywords
lastOffset
private int lastOffset
FortranTokenMarker
public FortranTokenMarker()
- Constructor, with a wee bit of initialization.
markTokensImpl
public byte markTokensImpl(byte token,
javax.swing.text.Segment line,
int lineIndex)
- Implementation of code to mark tokens.
- Specified by:
markTokensImpl in class TokenMarker
checkStartEditPage
private boolean checkStartEditPage(javax.swing.text.Segment line)
doKeyword
private void doKeyword(javax.swing.text.Segment line,
int keywordEnd)
- Add the latest token to the current list.
Process 'START' as a special case.
guardedAddToken
private void guardedAddToken(int len,
byte token)
- Call addToken only if the length of the token is not 0.
getKeywords
public static KeywordMap getKeywords()
- Return the keyword map.
It's lazily initialized on the first call.