Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gjt.sp.jedit.syntax
Class FortranTokenMarker  view FortranTokenMarker download FortranTokenMarker.java

java.lang.Object
  extended byorg.gjt.sp.jedit.syntax.TokenMarker
      extended byorg.gjt.sp.jedit.syntax.FortranTokenMarker

public class FortranTokenMarker
extends TokenMarker

Custom TokenMarker for UNISYS's ASCII FORTRAN 77. Characteristics of this dialect are:

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.


Nested Class Summary
 
Nested classes inherited from class org.gjt.sp.jedit.syntax.TokenMarker
TokenMarker.LineInfo
 
Field Summary
private static KeywordMap fortranKeywords
           
private  KeywordMap keywords
           
private  int lastOffset
           
private static int MAYBE_KEYWORD_FIRST
           
private static int MAYBE_KEYWORD_MORE
           
private static java.lang.String S_E_P
           
 
Fields inherited from class org.gjt.sp.jedit.syntax.TokenMarker
firstToken, lastLine, lastToken, length, lineInfo, nextLineRequested
 
Constructor Summary
FortranTokenMarker()
          Constructor, with a wee bit of initialization.
 
Method Summary
private  boolean checkStartEditPage(javax.swing.text.Segment line)
           
private  void doKeyword(javax.swing.text.Segment line, int keywordEnd)
          Add the latest token to the current list.
static KeywordMap getKeywords()
          Return the keyword map.
private  void guardedAddToken(int len, byte token)
          Call addToken only if the length of the token is not 0.
 byte markTokensImpl(byte token, javax.swing.text.Segment line, int lineIndex)
          Implementation of code to mark tokens.
 
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
 

Field Detail

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
Constructor Detail

FortranTokenMarker

public FortranTokenMarker()
Constructor, with a wee bit of initialization.

Method Detail

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.